Field Script Triggers
While FileMaker lacks an extensive event based user interface, it is possible to trigger scripts based on a variety of situations. If you need to trigger a script based on the creation, deletion or edit of a record, then this is possible.
What you need is a script triggering plug-in. There are a few of them out there. The one I choose to use for most all of my projects is named zippScript. In this video, I'll show you a simple method for triggering a script based on when a user leaves a field. The utility of this feature is as wide as you can imagine. For my purpose, I simply need to execute a search when the user leaves the global search field.
Comments
Annoying Beeping issue with New Windows
A subscriber named Glenn wrote me an email with a message about the use of zippScript when making a new window within the triggered FileMaker script...
It turns out, the issue is tied to a common dialog we have all seen as some point in time. It's the dialog that tells you about tabbing into fields or that no records are present to tab into.
As soon as you tab out of a field, FileMaker is expecting to go to the next field in the tab order. You would think it would just head into the first field within the new window. However, FileMaker has just changed context (potentially) because of the new window. The beep comes from the fact that it can't tab into the next field in the previous window because it now has a new window in front.
If you head into Layout mode, and select the field behavior for the triggering field, you can turn off the Tab option and select either the Return or Enter key as options for moving to the next field (object).
You will now notice the annoying beeping won't happen - because FileMaker didn't receive a tab key event. Yes, this is a FileMaker issue and not tied to the plug-in. It's the plug-in that is creating a state in which FileMaker didn't quite anticipate.
So, if you're fond of using the tab key to exit the field and you want to create a new window then you can't. You'll have to be content with either throwing up a dialog (something that interupts FileMaker so it can take a breath) or use the Return or Enter key as triggering events.
Thanks for finding this one Glenn!
-- Matt Petrowsky - ISO FileMaker Magazine Editor