1 Reply Latest reply on Aug 15, 2014 8:25 AM by philmodjunk

    Script variable in Perform Find script step



      Script variable in Perform Find script step


           FM 12. I’m trying to use script variables to find groups of records. Each record has the field Record# and values range from 1 to 100.

           The script uses the following steps to find sets of 12 records:

           Set Variable: [$$T=12]

           The first find:                              Find [Record#:1-$$T]

           The second find:                        Find [Record#: $$T...2*$$T]

           The first find works ok, but the second find yields the “no records found” error.

        • 1. Re: Script variable in Perform Find script step

               Neither should work. You can't put calculation expressions inside stored find criteria of your perform find or enter find mode script steps. You can only use literal values or the name of a variable.

               Try this form of a scripted find:

               Enter Find mode [] ---> clear the pause check box
               Set Field [YourTable::Record# ; $$T & "..." & 2*$$T ]
               Perform Find []

               This script is patterned after the scripted find examples found here: Scripted Find Examples

               To post a script to the forum:

          1.           You can upload a screen shot of your script by using the Upload an Image controls located just below Post a New Answer.
          3.           You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
          5.           If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
          7.           If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.