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

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

Recommended Posts

Posted

This is probably simple but I'm struggling to figure it out....

How do you create a deletion rule which prevents a user deleting a parent record if it has any children thus avoiding the possibility of orphaned records?

I guess it involves the "when deleting a record in this file, also delete related records" checkbox in the edit relationship popup however as far as I can see checking it will result in parent and child both being deleted and leaving it blank will result in orphans.

I'm looking to implement a solution that forces the user to delete any existing child records prior to being able to delete the parent.

Any advice much appreciated.

Iain

Posted

You set all passwords except for the master to Edit Only in File->Access Privileges->Passwords. Then you script all deletions, testing

If [relationship::constant]

Show Message ["You must first delete child records yadda yadda..."]

Else

Delete Record/Request [No dialog]

End If

where constant is a calculated field always equal to 1. If you don't have a constant, use If [Length( relationship::serial )].

This topic is 7778 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.