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

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

Recommended Posts

Posted

I currently use an If statement that checks for the last error of 101 to detect if there are no related records before continuing in a script. Is there a better way to test for no related records in a script?

I currently do this:

Go to Related Record [show only related records; From table: ...]

If [Get (LastError) = 101]

Exit Script

End If

Continue on with script

Kind of a basic question, but checking for a general error number of 101 is kind of risky.

Thanks.

Posted

Yes, it is risky. There are issues with the error codes and GTRR. I prefer to check for related records before the GTRR.

If[Count(related_table::primary_Key)]

Go to related record

Else

Show Custom Dialog["There are no related records."]

Exit Script

End If

See this thread for an overview.

Posted

I think I read this to say the same thing.

http://www.filemaker.com/help/FunctionsRef-311.html

Lee

Posted

Thanks guys! I'm going to update the scripts and sleep easier now.

Posted

Be careful with matching foundset GTRR, for which this won't work.

Also, ensure that all your privilege sets give access to destination layout. You can have related records without having the permission to GTRR.

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