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.

extend found sets without losing position

Featured Replies

hi all,

i'm sure this has been covered before but i can't find a way to extend a found set without losing the original record I found.

Let's say I search for

recordID=255
 

which pulls up the correct record immediately. I then want to extend the found set to include 


location=Overseas

However, this effectively makes me go to another record than 255.

I've also tried

1. search for recordID - 255

2. show all records (this keeps the desired position)

3. omit records where location not=Overseas

The only way i can think of doing this atm is to loop through all the records again until i get to the one i want, but it seems that there must be a much simpler/more efficient way.

Basically, I want to replicate the "go to related record" script step without using a portal

Since you have marked you profile with advanced, would a posible solution be to enter a CF in a Go To Record statement:

Sift(target;found;theField) = Case(target = GetNthRecord ( theField ; found );found;Sift(target;found-1;theField))

So yes it's basicly a looping, but hopefully a little faster than scripted looping???

BTW when and where is such funtionality really required?

--sd

Untitled.zip

That is a cool Custom Function. But in this case couldn't you also use a global to capture a unique value, then use Go To Related Record to go to it? Just don't check "Show only related". I don't know which would be faster.

Sift_GoToRecord.zip

Indeed, it just escaped me in the moment - it must be faster! Although globalizing everything to your hearts desires - not is fully embraced as programming habit ...at least in other tools than filemaker:

A global variable therefore has an unlimited potential for creating mutual dependencies, and adding mutual dependencies increases complexity

http://en.wikipedia.org/wiki/Global_variable

--sd

  • Author

thanks to both of you, both solutions work fine. I'll probably use fenton's purely because I may be able to use that global field for other things as well.

To answer your original question, what this is for is to create a previous/next record button, but to have the button actually display the record title of the previous/next records. Previously I'd been using a set of relationships to work this out, but a problem arises when two records share the same title, also this method will allow for customised sorts.

I may be able to use that global field for other things as well

Danger! It was exactly the point quoted from wiki... a collectors bad habit in thinking something might come in handy later - localize and narrow the scope, or sit for hours to document dependencies!

--sd

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.