Skip to main content
Suggested answer

Code architecture for a simple copy data routine

editSubscribe (0) ShareShare
ReportReport
Posted on by 9
Dear Community,
 
I came from a different programming language and I am new to AL.
 
For an interface between BC and a MES System I want to catch all changes on the Production Order Line Table and copy these changes to a separate table. Later, I want to make them accessible via REST.
 
I am wondering which of the following architectures would be the most AL typic approach:
 
Solution one:
1. Writing a Codeunit that does the Copy Job i. e. transferring data from production order line table to the new table
2. Calling these Codeunit from the OnInsert, OnModify, etc. Triggers at the production order line Table.
 
Solution two:
1. Writing a Codeunit that does the Copy Job i. e. transferring data from production order line table to the new table
2. Extending this Codeunit with an EventSubscriber that is listening on Prod. Order Line Table.
 
I appreciate your help!