October 19, 200421 yr 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 :-)
October 19, 200421 yr After the Perform Find: If( Status (CurrentFoundCount) > gHowMany ) . Go to record ( no dialog, gHowMany ) . Omit multiple ( no dialog, 99999999 ) End If
October 20, 200421 yr Author 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?
October 22, 200421 yr 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.
October 22, 200421 yr 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.
October 24, 200421 yr Author great. thanks Tom. I was not sure if the 9999999 meant something specific. makes sense now. I'm going to try again.
October 25, 200421 yr FYI, Omit multiple ( no dialog, 99999999 ) does not require error capture on, the "no dialog" does the trick.
October 25, 200421 yr 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.
Create an account or sign in to comment