Hey Mark,
Great Question.
To keep it align to base Microsoft approach I would suggest this -
1. Use Page Extensions for adding actions in the Sales order subform and Blanket Sales order Subform.
2. Page Extension only adds the action on the page and calls a function.
3. The Code that executes the business logic should be placed in a codeunit function which then gets triggered from both actions.
** Benefits of this approach.
1. All Business Logic is supposed to be in one place (Codeunits).
2. Pages and Tables are not supposed to be heavily coded ever.
3. Easy to Manage in future, as you will only have to update the Function once in a codeunit and it will apply changes to both actions.
4. It aligns with Microsoft Best Practice for Development either in C/AL or AL.
I hope it helps.
------------------------------
Saurav Dhyani
Upgrade Technical Futurist
ArcherPoint Inc.
Duluth
Blog -
https://saurav-nav.blogspot.com------------------------------
Original Message:
Sent: Feb 24, 2020 06:55 PM
From: Mark Anderson
Subject: Writing an AL Extension to Update Sales Lines
There doesn't seem to be a way to delete posts, and I solved it
In case anyone else has same problem, I created a page extension on the Sales Order Subform and used and action to add to the Line menu
------------------------------
Mark Anderson
Director of ERP Systems
Clesen Wholesale
Evanston, IL
Original Message:
Sent: Feb 24, 2020 12:56 PM
From: Mark Anderson
Subject: Writing an AL Extension to Update Sales Lines
Hi All
Written some table extensions, page extensions and reports in AL.
I now need to write an extension that can update sales lines (several different functions), so i need to add a menu item to the Sales Line Sub Form (for sales orders and blanket sales orders). When the user selects one of the possible functions, it will iterate through all sales lines and set various values.
I'm a bit puzzled on how to start. Have a few questions:
Would this be a page extension?
How would I add a menu item to the Line menu on the sub form?
Thanks
mark
------------------------------
Mark Anderson
Director of ERP Systems
Clesen Wholesale
Evanston, IL
------------------------------