Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Trouble with deleting related records

Featured Replies

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

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

Can´t think of any (if you have full authority)

  • Author

David,

Yes that would work well, but I am not deleting the parent record only the related ones.

Thanks for your input.

Ted

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.