Cascade Delete Records?

If there’s a clear parent-child relationship where you don’t want to allow orphans.

Whenever the parent (e.g. Lead Source) is deleted, all the children (e.g. Leads collection) are automatically deleted so that there can never be a child unlinked from a parent.

Postgres calls it “On Delete, Cascade” — I’m not sure if Noloco’s database could support this, but it’s worth mentioning because it would be so helpful.

Hey @fundmore - we don’t offer anything like this by default, but you can very easily set this up.

Add a workflow when a record is deleted, and then directly delete all the children for example.

1 Like

Hi Darragh, thanks for the suggestion.

I thought about doing that — but in practice I wouldn’t just want to delete the children, but the grandchildren and great-grandchildren etc.

E.g. when you delete a Lead Source, auto delete its Leads collection, then auto delete each Lead’s Deal collection, then each Deal’s Submissions collection, etc.

I suppose you could have a workflow for each table set to trigger on delete, which would iterate over the children and delete them.

The only issue is that each record will trigger its own workflow run, and it’ll cost too many workflow runs in the aggregate.

1 Like

I actually LOVE this request because I have spent way too much time engineering “Delete” buttons to wipe out many related records. For example, in a manufacturing app, deleting a purchase order should delete a project which should delete all of that project’s parts, which should also delete the purchase order’s quote, which should also delete that quote’s line items, etc etc.

It’s tedious to build those workflows out and this would be helpful

1 Like