Jump 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.

Constrain to Current Record?

Featured Replies

I'm thinking there is surely an easy answer to this, but I'm not finding it. Is there a way to constrain the found set to just the current record? Or put another way - omit all records except the current record?  I can certainly write a little find routine to do this, but I figured there might be something I'm overlooking?

if the record you are on has a UNIQUE primary key, you can use the Find Matching Records [] script step on that field.

Hope this helps!

Another option which may work better in other situations where the record is not unique ... 

Freeze Window
Show All Records
Omit Record
Show Omitted Only
Loop
Exit Loop If [ Get ( FoundCount ) = 1
Go To Record/Request/Page [ Last ]
Omit Record
End Loop

This was presented by JT aka -Queue- many years ago.  The reason the loop is important is that, in the instant the step 'Show Omitted Only' fires, if another User creates a new record, it could also end up in your found set.  That other-user-created record would be after your record so the loop omits it if it should occur.

  • Author

Thanks folks!

Another method is Go To Related Record, current layout, using a relationship that matches primary key to primary key.

Good point, Barbara.  Of course this does require a self-join relationship.  Adding a table occurrence just to provide this functionality is a bit much but if it already exists and there is a unique Key (which there should always be) then one can use it.   

Don's suggestion is ideal since it requires the least amount of support.  All tables should contain a *unique ID although some do not, which is why I made the alternate suggestion.

* Some tables lack a unique ID because of migration in progress or because the developer thought a primary key is only necessary if the table is going to be used in a relationship but this is incorrect ... ALL tables should contain a unique ID.

Nice to see you around!  :-)

Good point, Barbara.  Of course this does require a self-join relationship.  Adding a table occurrence just to provide this functionality is a bit much but if it already exists and there is a unique Key (which there should always be) then one can use it.

Another option — not necessarily better than Don's, but having options is good — would be to leverage Selector-Connector (if you've already got that approach in place, that is).

Set the respective "id" field in the Selector table to the current record's id, then GTRR from that table to the connected occurrence of the current table.  In S/C, each main table usually will have a second occurrence hanging off of the Selector table, so it avoids adding a TO just to provide the functionality of isolating the current record.  - Just a thought.

BTW…

ALL tables should contain a unique ID.

Couldn't agree more, LaRetta!  Thanks for reminding us of that.

Mark

Edited by Mark Scott

By the way, thanks for mentioning Selector-Connector which is a new structural concept Selector-Connector by Todd Geist.

Should a single-record prefs table have a unique ID field?

Ah, thank you - that wouldn't make sense, now would it, Tom!

The purpose of the unique ID (aside from relationships) is to provide a means of data retrieval allowing import (Update and/or Add To) based upon matching ID.  It is critically important.  You understand this of course, Tom.

However, I do believe that a single-record table should have auto-enter data of 1 and then validate that one_record_only field to 'unique always, do not allow override' so in a sense, it has a unique ID as well. :-)

Haha - we can officially called the cat skinned ;oP

Haha - we can officially called the cat skinned ;oP

Not any of MY family, I hope!  We're a bit sensitive about the hairless cat jokes.  :console:

One thing I love about this forum is that we present options and, as Mark said, options are always good and we've covered every possibility now, that's for sure!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

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.