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

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

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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.

Posted

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

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