Delete subform lines automatically

How can you make the subform lines get automatically deleted ?

Do you have to program this in the OnDelete trigger of the main form its source table?

Or is this some property of the main form?

Answers

  • Have a look at table 36 Sales Header


    Albert
  • If you need the system to automatically delete records in related tables when a record is deleted in a certain table, you need to program this in the table's OnDelete trigger.

    Albert's suggestion of looking at the Sales Header table is an excellent example. Open the table designer for this table, and look at the C/AL editor. Start at the top of the code and scroll down until you reach the OnDelete trigger. In here you will see everything that happens when a record in the Sales Header table is deleted by a user (i.e. on a form).