Saturday, October 20, 2018

Table Trigger available with extended table and sequence of execution

Hello Friends,

With new version of AL Code, Now the table base trigger available with extended tables and we can use it as normal table trigger.

The tableextension object has four new triggers:
  • OnInsert
  • OnModify
  • OnDelete
  • OnRename




















What are these triggers and how are they related to the OnInsert / etc. triggers in the base table? And what’s the difference with the already existing OnBefore and OnAfter triggers in the tableextension object?
The difference is that these new triggers will be executed before the data of the table has been written to the database. While the OnAfter triggers will be executed after the data has been written to the database.
Table extension trigger execute before the table trigger.
With so many triggers and events, I thought it would be a good idea to compose a list with the correct order in which they are executed. So here is a table for the database insert (same applies to modify, delete and rename of course):

Thank you reading,
Let write in comments if you want to know more detail.

No comments:

Post a Comment