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

Trouble with deleting related records


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

Recommended Posts

Posted

I have a script which deletes related records using the GTRR and DELETE RECORDS script steps. The script seems to work perfectly 99.9% of the time but has on two occasions deleted records in the parent table not the related table. And yes, there is an IF step directly before the GTRR which checks for the presence of related records: a symplified version of the syntax I used is

IF[count(related table:related table ID)>0]

GTRR

Delete Record

ELSE

Exit Script

End IF

My question is are there any situations (record locking, multi user, multi window?) in FM7 which would result in a failure of the GTRR step to actually go to related table assuming that the IF statement was valid?

Thanks,

Ted

Posted

Why don't you set up the relationship so that related records are deleted when the parent is deleted? No need for scripts at all, 100% reliable.

David

Posted

I don't know about your original record-locking question, but maybe you could avoid it by using a portal and deleting portal rows until you get a portal row error? Basically, you set up a loop that goes to the first row of the portal and deletes it until there are no related rows and FM throws an error.

Cheers,

David

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