Function “OnAfterOnDatabaseDelete” from the codeunit 1 ApplicationManagement

LoufusLoufus Member Posts: 5
Hello everyone
I am using the function “OnAfterOnDatabaseDelete” from the codeunit 1 ApplicationManagement to record the deletions that happened from the database

6hbdz2seva4k.jpg

I am not recording every single deletions, I am actually using a setup table that contains the tables I need to record
However, the problem is that this function only catches the deletion that happen from standard tables (such as Sales Header, Customer …) but it does not catch those that happen from custom tables.
Any idea how I can make it work for custom tables
Thanks in advance.

Best Answer

  • DuikmeesterDuikmeester Member Posts: 304
    edited 2019-05-21 Answer ✓
    Make a GetDatabaseTableTriggerSetup subscriber and set OnDatabaseDelete parameter TRUE for all your tables. Don't set any FALSE or else you influence standard functionality.

Answers

  • DuikmeesterDuikmeester Member Posts: 304
    edited 2019-05-21 Answer ✓
    Make a GetDatabaseTableTriggerSetup subscriber and set OnDatabaseDelete parameter TRUE for all your tables. Don't set any FALSE or else you influence standard functionality.
  • LoufusLoufus Member Posts: 5
    Thanks a lot that seems to be working :)
  • robbonickrobbonick Member Posts: 40
    Could you not just use Change Log Entries to track the deletes from the tables you require?
  • DuikmeesterDuikmeester Member Posts: 304
    edited 2019-05-22
    @robbonick that would cause the Change Log Entries to flood with info you would like to use otherwise.
  • robbonickrobbonick Member Posts: 40
    Yeah I guess if you are tracking Modifications, Inserts and Deletes for the given table. I guess I was just trying to offer an option which requires no code changes. Of course I understand there are instances where this is not a viable option.
Sign In or Register to comment.