Deleting parent deletes children

Sometimes, when deleting the parent object (row), you want to delete the children objects (rows in another table) that are connected to this. Happens when:

  • Meetings have topics and action items. When you delete the meeting, you no longer want action items and topics for that meeting in the other tables.
  • Delete the company in your CRM, you no longer want the contacts connected to it.
  • Delete the project, the tasks no longer apply.

Here’s a doc and explainer video showing how to implement:

3 Likes

Alternative way for those who prefer formulas: instead of deleting from another table where Meeting = thisRow, you can delete by references pulled via lookups:

RunActions(
  thisRow.Tasks.Filter(true).DeleteRows(),
  thisRow.Topics.Filter(true).DeleteRows(),
  thisRow.DeleteRows()
)

This is especially useful if the condition for the lookup is more than just something = thisRow.

Filter(true) is the trick to convert a list of rows into a “virtual” table that you can feed to DeleteRows(). Simply thisRow.Tasks.DeleteRows() won’t work. Props to @Dalmo_Mendonca for the trick:

6 Likes