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.

What if goto related records finds nothing?

Featured Replies

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

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

  • Author

thanx - you are right - I forgot about IsValid function,

appreciate it

have a nice day

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

I'm with Vaughan, I prefer the Count() approach over IsValid.

-bd

If you use error capture than check for error 101.

Dj

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

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

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

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

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.