How do you Create a button that delete a record and all child records connected

Does anyone know how to create a button that delete a parent record and all the child records connected to it? The default delete button that comes with knack only delete one record and not the records associated with it. Thanks guys!

Hi Victor

You are correct that Knack does not have any built in 'cascade delete' option (as you would find in, say, Access). It would probably be possible to write some Javascript for this but it would be pretty scary stuff!

What I do in these circumstances it have an Integromat process searching for record marked for deletion in some way (your 'delete' button could set a field value) and then delete all the relevant records. It's fairly simple to do but you need to remember to delete all the child records first - and finally the parent that you had marked for deletion.

A cascade delete option (which you could set when creating the connection) would be really useful - if you agree then upvote this post/comment!

 

3 Likes