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.

Check for related using found set

Featured Replies

I'm drawing a blank here. :P I want to see if any of the records in my found set (Contacts) has a related record in another table (Dealers). The Contacts records would have a foreign key _kF_DealerID populated.

I know I can gtrr in a new window and check the found count, but there must be a calc I can do. If I do a gtrr using found set, and the first record does not have a related record, then Get (LastError) = 101. So, I can't use that.

GetNthRecord somehow?

  • Author

Well, I ended up using Constrain. After my find, I constrain the found set to only include records where _kF_DealerID is not empty (*). If the foundcount=0, I have not found any contacts that are dealers.

I'm still betting there's a better way.

If you used a Custom Function to gather the IDs in the found set (unstored calculation), then a relationship from that field to the ID in the other table would tell you if any had a match. Or, you could use the Copy All Records copy/paste into a global field trick (old but fast; requires script).

How do you count records in the found set that fulfill a certain condition? Usually, you'd formulate the condition as a boolean, and then use a summary field to sum/count the result. I don't see why this couldn't be done the same way.

  • Author

Yes, exactly. And by using constrain I don't need a summary field in the current table or a flag field (since I have the foreign key to search)or a new relationship or a custom function.

I just thought I was missing an obvious calc or use of GetNthRecord. Guess not. I often use if not Isempty(related field) to see if a single record has any relatives, but haven't needed to see if any found records have relatives.

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.