Database Reference
In-Depth Information
the sort needed for your report, the Sort script step's dialog box will have the settings you
need when you're actually creating the script.
So run through the steps necessary to find Invoices with a balance due, and take notes. You'll
probably end up with something like the following:
Switch to the “Invoices with Balance Due” layout . This layout has the fields the script
needs to create the invoice list. It's also going to display the final list, so make sure the
script runs in this layout.
Choose View Find Mode . Whether you're doing a find manually or by script, you
have to start by switching to Find mode.
In the Balance Due field, enter “>0,” and then press Enter . FileMaker scripts use a
step called Set Field to enter data into fields. Then a separate step performs the find
and shows the correct records, just as if you'd performed the find yourself.
NOTE
If none of your invoices has a balance due, just click Cancel when the error message pops up
and then choose Records→Show All Records so you can do the next step. Note that your script
needs to account for this message box if it pops up when someone runs your script. In
Chapter 17 you'll learn how to make your scripts account for errors like these.
Choose Records Sort Records and then sort the records ascending by Date Due .
You should now see your final list, properly sorted.
Now that you know all the steps involved, you're ready to get acquainted with the Edit Script
window. Figure 11-2 shows a complete script to do the steps in this section. Because
FileMaker Pro's scripting uses natural language in its script steps, even if you know nothing
about scripting, you can probably read the script and get a general idea of what it does. Later
scripting chapters will teach you about the other script steps and how to use them.
Creating Your Script
You create, edit, run, and delete scripts in FileMaker by using the Manage Scripts window.
It's the first item in the Scripts menu, and it's available from any mode, except while a script
is running. When you choose this command, you see the window shown in Figure 11-3 . Your
window may not have scripts in it yet, but otherwise, it's the same.
Now it's time to build the script. Basically, you tell FileMaker to repeat each of the steps you
went through when you planned the script. Here's how:
Search WWH ::




Custom Search