JD Scott Posted October 19, 2004 Posted October 19, 2004 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 :-)
Fitch Posted October 19, 2004 Posted October 19, 2004 After the Perform Find: If( Status (CurrentFoundCount) > gHowMany ) . Go to record ( no dialog, gHowMany ) . Omit multiple ( no dialog, 99999999 ) End If
JD Scott Posted October 20, 2004 Author Posted October 20, 2004 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?
Fitch Posted October 22, 2004 Posted October 22, 2004 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.
MoonShadow Posted October 22, 2004 Posted October 22, 2004 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.
JD Scott Posted October 24, 2004 Author Posted October 24, 2004 great. thanks Tom. I was not sure if the 9999999 meant something specific. makes sense now. I'm going to try again.
Fitch Posted October 25, 2004 Posted October 25, 2004 FYI, Omit multiple ( no dialog, 99999999 ) does not require error capture on, the "no dialog" does the trick.
MoonShadow Posted October 25, 2004 Posted October 25, 2004 Ahhhhh, makes sense. I've only used this to perform manual omit - no 'No Dialog' displays. That explains the error message then. Thank you, Tom.
Recommended Posts
This topic is 7675 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 accountSign in
Already have an account? Sign in here.
Sign In Now