Database Reference
In-Depth Information
Figure 12-12. Here's how your OnModeEnter trigger looks once you've configured it. To recap,
whenever someone enters Find mode on this layout, the Find Customers script runs automatically.
When you're done, click OK to go back to the Layout Setup dialog box, save your layout
and then switch to Browse mode. Now, switch to Find mode by using any available method
and bask in the glory of script triggers, as FileMaker automatically starts your stylish find
process.
NOTE
This script runs perfectly as long as the user searches for and finds a record. But if no records are
found, or if the user wants to change his mind, your script has to get smarter so that it doesn't leave
the user on the Find layout or choke on an error. You'll learn about handling errors on Handling Er-
rors . Combine that knowledge with an If script step, and you'll be able to put your user back on the
right layout, and in the right mode, no matter what happens. In the meantime, the sample file shows
you one way to strengthen your script.
Search WWH ::




Custom Search