Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

'Delete related records' option on Relationship - what!?


This topic is 4459 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

The other day I turned on the "delete related records in this table when record is deleted in other table" setting on a relationship on the graph. Very rarely do I use this feature but it would prove to come in useful for a particular script.

So I turned the option on a single relationship on the graph, expecting that when a record is deleted from the context of the parent, that the child records are deleted, and it worked fine.

Now today I put a portal on a layout based on an entirely different table occurrence of the parent, and run a script in that portal that does a "delete portal row" - however this is still deleting the child record!

In other words - even though the option is turned on for a completely separate relationship altogether on an entirely different part of the graph, this single setting on this relationship affects the entire graph. No matter where I delete a parent record from the children are now deleted.

To me this seems completely wrong, if you are going to have this setting, then the relationship setup is the wrong place for it, because it is behaving like a global setting.

Anyways this completely threw me - can anyone shed any light on whether this has always been the behavior of this setting, and whether this is a bug or just the way it has always worked?

Posted (edited)

I believe it has always worked that way, and that is the intended behavior. It is designed to prevent the creation of orphans as a data integrity rule - similar to validation.

if you are going to have this setting, then the relationship setup is the wrong place for it

Possibly, but there doesn't seem to be another place to put it.

---

One more thing:

even though the option is turned on for a completely separate relationship altogether on an entirely different part of the graph, this single setting on this relationship affects the entire graph. No matter where I delete a parent record from the children are now deleted.

Note that when you delete a parent record from another parent TO, the children deleted are the children that are related to the deleted parent via the original relationship - the one where the delete option is selected. So it is not exactly a global setting.

Edited by comment
Posted

In other words, when you delete a record in the second occurrence of the Parent table, you are of course deleting a record in the original occurrence and this will trigger deletion of records in the child table connected to the original parent. If you had a different child table related to the second Parent table occurrence and did not check the "delete related records . . ." box, the second parent would not delete records from the child. This seems to make sense to me.

Posted

when you delete a record in the second occurrence of the Parent table, you are of course deleting a record in the original occurrence

Yes, that's a good way to look at it.

This topic is 4459 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.