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

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

Recommended Posts

Posted

How can I make a Perform Find script step find only a certain amount of records, say, the most recent 1000 records that otherwise fit the find criteria.

I have started down this path for a solution:

I made a Show Dialog step that asks for the user to enter the number of records to find...lets say they enter 1000.

That number 1000 goes into a global field to be used during the part of the script which says how many records to find.

thats as far as I get :-)

Posted

After the Perform Find:

If( Status (CurrentFoundCount) > gHowMany )

. Go to record ( no dialog, gHowMany )

. Omit multiple ( no dialog, 99999999 )

End If

Posted

Thanks Tom. I don't understand the script but I was excited to try it anyway. but...

I cannot put Status in my script. "This function cannot be found"

what am I doing wrong?

Posted

JD, here's an explanation of the script:

There is no FileMaker command to find only a certain number of records. So instead, we'll have to Omit the records we don't want from our found set.

If( Get(FoundCount) > gHowMany )

-- Get(FoundCount) is the number of records we just found, or it could be all records, doesn't matter

-- gHowMany is the global field you talked about

-- So for example if you've found only 500 records, there's no need to omit any. ( 500 is not greater than 1000 )

. Go to record ( no dialog, gHowMany )

-- This is actually not quite right. It should be (gHowMany + 1). So if you enter 1000 into the field, you'll go to record 1001.

. Omit multiple ( no dialog, 99999999 )

-- This is just an arbitrarily large number, so that it will omit all the remaining records.

End If

Hope that makes sense to you now. Sorry for the errors.

Posted

I believe you must also be sure Set Error Capture [On] is in the script; otherwise, you'll get the FM dialog telling you there aren't that many records. And thanks for the very nice explanation, Tom. I think many people aren't aware of the power of using this. I've rarely used it myself. smile.gif

Posted

FYI, Omit multiple ( no dialog, 99999999 ) does not require error capture on, the "no dialog" does the trick.

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