October 19, 200520 yr 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
October 19, 200520 yr 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
October 21, 200520 yr Author David, Yes that would work well, but I am not deleting the parent record only the related ones. Thanks for your input. Ted
October 22, 200520 yr 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
Create an account or sign in to comment