I'm trying to intercept delete events for any table, as I am trying to create a generic (to any table) drag and drop data store and I will need to see if the associated record has any data storage links associated with it that need to be deleted. I'm trying to intercept global deletes via event subscriptions to codeunit 1 however it does not appear that OnAfterOnGlobalDelete or OnAfterOnDatabaseDelete are being triggered when records are deleted. I have tested this successfully on a table specific event by subscribing to an event on a specific table (table 27), but I was hoping to make a more generic solution that can be used on any table by making use of the codeunit 1 events.
Is this currently not implemented, is there a different event, or am I doing something wrong?
0
Answers
Check function GetDatabaseTableTriggerSetup - you have to set up OnDatabaseDelete parameter to TRUE if you would like to run OnAfterOnGlobalDelete. Or if you don't want to modify CU1, you can create subscriber to OnAfterGetDatabaseTableTriggerSetup in CU1.
Or just add the requested table to the change log setup table