Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hey guys,

When I use a command "Goto related record" and there is no related record in other file - the script does nothing. How can I recognize that there is no related record and react respectively on that event?

Is there any status function to recognize that? (I would like to view all records in such a case).

Thanks for help

Posted

You can test for related records with the IsValid() function, e.g.

If IsValid(RelationshipName::RelatedForeignKey)

Go to Related Records (RelationshipName)

Else

Show Message "There are no related records"

End If

Posted

I use the Count() function to count the number of related records.

Posted

IsValid() hasn't given me any trouble yet -- any particular reason why Count() is the way to go, other than precision perhaps?

Posted

I've another question, similar to the one before:

i need the same event "no records found" when i use find mode script.

So if i search a particular record and i have no mathes i'd like to see a message like "sorry, your request found 0 records" instead of the basic window of fmp "no records found: continue, cancel,ec...... the script".

How it can be done?

Thanks

Posted

IsValid() hasn't given me any trouble too but according to FM sources the "right" function to test for presence of related records should be IsEmpty(Relationship::Any field that ALWAYS has a value)

Count() does work but might slow things down since it has to take into account all related records, while IsEmpty () will check only the first related record

Posted

Hmmm thanks for the tip, Pupiweb. I can see the sense in IsEmpty(). A good field to test would be the remote key.

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