[Forums] [Shop] [Resources] [Training] [About] [Solutions] [Consulting] [News] [Links]

Questions s I hope you enjoy this FREE online training. Let me know if you'd like to see more! You can email me at jmo@filemakerpros.com. And, if you really like this online training, consider one of my live classes based on my wildly popular book and CD ROM. Happy FileMaking!

Updating the Find Criteria

What if you decide you want to change the restored find criteria in the Perfom Find script step shown in the first exercise? The process is very simple once you know the steps.

1. Manually perform the find with the new find criteria you desire
2. Choose ScriptMaker from the Script menu
3. Double-click on the Restore Find script to open it
4. Click the OK button to accept the script and you will see the following dialog

Find/Replace or Store Settings dialog

5. Select the Replace radio button next to Find Requests and click OK

Notice that some of the options in the Store Settings dialog are dimmed. FileMaker is smart enough to know that this script only restores criteria for a find request.

When you change the radio button from Keep to Replace, FileMaker captures the find criteria from the last performed find and stores it in the script. This replaces the find criteria previously stored in the script. If the radio button is left on Keep, the script is not modified. You will see this dialog everytime you click the OK button to accept a script that contains restored script commands. Most of the time, you will just click the OK button.

Exercise: Modify the script that you created from the first section to find all records that contain a name that starts with "H" in the Text Entry field.

Advanced Exercise: It is only possible to have one restored find per script. Think about it. If you add two different Perform Find [Restore] script steps to a single script, how will FileMaker know which one should contain which find criteria? Using modular scripting, make it so a single script can perform two different finds depending on the circumstances. Modular scripting is the process of making a single script into multiple scripts. The scripts call each other with the Perform Script step.

For example, let's say you wanted a script to perform a date find when the currently selected field is the Date Entry field or a text find when the Text Entry field is selected. The find for the date field will be ">1/1/98" and the find for the text field will be "J".

More than one Find script in RESTORE.fp5

The solution requires a nested If statement that checks to see what field is selected and calls the appropriate sub-script with the Perform Script command.

Previous | Next


Exclamation s Database Pros offers training classes across the globe. Classes include the wildly popular Intermediate and Advanced Scriptology training series.


Database Pros