pbakker:
The way it is worded makes it sound like “Allow parent delete when having related records” overrules “Delete related records” for that relation. The fact is, the two have nothing to do with each other in the current relation. “Allow parent delete when having related records” only overrules “Delete related records” for relations “up” the relation chain from the current one. This is an important distinction.
Maybe we’re hitting a language barrier here, because as far as I can see what I wrote is 100% correct: If you set “Allow parent delete when having related records” to false, the “Delete related records” setting is ignored.
I think a language barrier. You use the term “overrules” which is incorrect for the current relation. You are correct that it does “ignore” but that should be fairly obvious that child records won’t be deleted if the parent can’t be deleted if there are child records…
“Overrules” does apply with cascading relations. “Allow parent delete when having related records” set to false will overrule a “Delete related records” setting any relation “up” the cascading relations path.
So “overrule” and “ignore” are two different things and behave quite differently.
pbakker:
I think the main thing to point out is that unless you’re implementing a business rule, you should have ALL the checkboxes checked when creating a relationship.
Can’t disagree with you more: you should use your brain when creating a relation and the settings should reflect your datamodel
If you have a relation “order_to_customer” that return the customer that the order belongs to, it would be plain wrong to set deleteRelatedRecords to true: If I delete an order, I do not want the customer to be deleted! And I do not want the relation to block the delete of my order record either, so allowParentDeleteWhenHavingRelatedRecords should be true as well.
In practice, how many relations implement record delete business rules compared to how many that don’t? In my experience, it’s quite a lopsided count in favor of the relations that don’t.
So while I agree that record delete business rules need to be very carefully thought out – once the core relations are in place that implement these rules all other relations that are used for filtering, grabbing data from multiple relations away, scripting, etc – these should be set to not impact the delete business rules set in the core business rules. And this is where developers trip themselves up ALL the time.
pbakker:
As said before; if you have suggestions how to improve things, please let us know by registering a feature request.
And as I’ve said before, a closed bug/feature request system is a waste of my time. If I can’t see, comment on, test, and vote on what everyone else is entering into the system, it does me very little good. We quit using the bug/feature request system years ago because it’s not useful in any way that is obvious to me.