Skip 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.

Set error captrure (on)

Featured Replies

It's a quick question and just need to make sure its meant to happen:

At the beginning of a script:

Set error capture (on)

Set $temp = header id

Go to layout step - where the layout's underlying table is not linked to the starting TO

Find command based on $temp

Check its the right number of records to delete

then delete records command

It seems that the "set error capture on" stops the go to layout from appearing which is fantastic

just i cant see that its meant to happen in any documentation

is this OK?

This doesn't address your question, but why are you finding child records this way? You should have a relationship between the two tables and use Go To Related Record script step.

I don't think the Set Error Capture is preventing the refresh of the window. You do have to trap, especially if you intent is to delete the found set!, to see if there are any child records. For example,

If ( not isempty (Parent::Child(fieldid))

GTRR (Parent::Child)

Delete All Records (no dialog?)

End if

Remember GTRR fails if there are no children, and you certainly don't want to delete all records in your parent table.

  • Author

Hi,

Thank you so much for posting - I have implemented your method (only took me a little while to work out that with this approach you have to delete the header/parent record last : ! - I am not that experienced but I am learning fast!)

I have really inherited this app (quite large) and on looking through similar routines none of them use a GTRR approach (anywhere)

Is this a programmers generational thing

It seems a lot more efficient to me to use the gtrr approach

Anyway once again many thanks

Simon

  • Author

having done all that ...

is this gtrr method a lot "safer" than using the "delete related records in this table when etc" option from the relationship?

I seem to remember somebody saying that you could get cascading deletes with the relationship settings.

Cheers

Simon

In your first post, you didn't mention that your goal was to delete both the parent and its children. If that's the case, just use the cascading delete (the delete records checkbox in the relationship). Actually, any mass delete/edit is potentially dangerous. That is why they are typically proceeded with a dialog (either your own scripted one or use FM's built in one).

  • Author

Hi,

I apologize, in my first post I was just trying to find out about a side effect of "set error trapping" etc, and not very well phrased at that.

In the event, having now learned a whole lot more )I have now used the relationship setting to delete the child records

(I do have plenty of warning messages in the script :-) )

Thanks

Simon

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.