Database Reference
In-Depth Information
Figure 17-15. 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. This is the warning you see if no records match the request in a scripted Find. It's just
like the normal Find error message, except there's also a Continue button.
If someone clicks Cancel in an error message, the script stops immediately and leaves him
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 when no records are found in a
search, gives users a third choice. The Modify Find button goes to Find mode on the current
layout and then pauses the script.
Sometimes this error-handling approach is just fine. If the script is simple and everyone us-
ing it knows a little about FileMaker, it's not a big problem. But often, you need more con-
trol:
▪ If your system is complex—or your database's users aren't experienced with
FileMaker—all sorts of confusion can result. First, the error message may make abso-
lutely no sense to the person reading it. Maybe your script searches for a Customer re-
cord before making a new invoice. If a message complains about not finding any records,
the person reading it thinks, “I just wanted to create a new invoice for this job. Who said
anything about finding records?” Even worse, if she clicks Cancel, she could wind up
just about anywhere: some layout in some window on some record. It could be a layout
(like a developer-only layout you created to make the script run) that she's never even
seen before.
▪ If an error happens in the middle of a larger multistep process, it might be really import-
ant that the script know about it and deal with it appropriately. But if you don't take con-
trol, it's the user , not the script , that decides whether to continue or cancel. You may
want to make sure the script always continues, so it can get on with important work.
Search WWH ::




Custom Search