Jump to content

Scripted delete record best practice


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

Recommended Posts

Making sure that you have the record(s) that you definitely want to delete as the found set. You should make sure that you properly error trap, especially when using GTRR as if there are none, you could be deleting out parent records.

Link to comment
Share on other sites

First I check to see if there is a related record.

If [ IsEmpty ( Child::ChildID ) ]

Set Error Capture [On]

Go to Related Records [show related only]

If [ Get (LastError) ]

Show Custom Dialog ["Error"]

Else

do something

End If

This is okay if you are using GTRR for the current parent record.

However, if you are trying to match on the found set, things are a little different for capturing the error code.

If none of the parent records have matching children records, then it should result in a 401 error.

If the first parent record does not have related records but some of the other parent records do, then it will result in a 101 error.

Link to comment
Share on other sites

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