Handling Errors

As discussed on Creating Your Script, when an error occurs during a script (a Perform Find finds no records, for instance), FileMaker shows an error message almost like the one it would if you were doing the steps manually. The one difference is a button called Continue, as Figure 15-12 explains.

If the user clicks a Cancel button in an error message, the script stops immediately, and leaves the user wherever the script was when it stopped. If he clicks Continue instead, FileMaker ignores the error and moves on with the script. In the Perform Find example, for instance, the script continues with no records in the found set. Some errors (like the one in Figure 15-12) give the user a third choice. If the user clicks Modify Find, for instance, FileMaker takes him to Find mode on the current layout and pauses the script.

Here’s the warning you’ll see if FileMaker can’t find records that match your request if you search within a script. When an error occurs during a script, FileMaker gives the user all the normal choices he’d usually see in a warning dialog box, plus the option to ignore the error and continue the script. In this case, the Continue button is added to the normal mix.

Figure 15-12. Here’s the warning you’ll see if FileMaker can’t find records that match your request if you search within a script. When an error occurs during a script, FileMaker gives the user all the normal choices he’d usually see in a warning dialog box, plus the option to ignore the error and continue the script. In this case, the Continue button is added to the normal mix.

Sometimes this error-handling approach is just fine. If the script is simple and everyone using it knows a little about FileMaker, it isn’t too big a problem. But often, you need ...

Get FileMaker Pro 9: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.