A table trigger is a C/AL function that is called by the NAV platform in response to certain events in the table, such as inserting or modifying a record, or entering a value in a table field. The key difference between a common C/AL function and a table trigger is that the latter cannot be called explicitly in application code; it is either initiated by user actions or called implicitly when other C/AL functions perform data manipulations on the table.
Then, we will implement several examples of table triggers bound to different actions on a table. The first example is the OnDelete trigger, invoked when a table record is being deleted. This trigger will delete all contract lines when the contract is deleted.
Open the 50500 Lease Contract Header table, in table designer and find the OnDelete trigger declaration. It has already been generated by the designer, so...