IF YOU ARE PREPPING for the FileMaker Certification test, you’ll need to know Script Triggers inside and out. Of course, to fully realize their utility, you need to study them closely, anyway. Consider the OnObjectExit script trigger:
Triggers a script to run before an active object is exited as a result of the following:
- a user tabs away from an object
- a user clicks a different object
- a script step attempts to make a different object be the active object
- a user requests a dialog box that would normally cause the field to be exited
- a user attempts to move between rows in a portal object
- a user attempts to move between repetitions in a repeating field
When the script runs
- Before the event has been processed.
Modes in which the trigger can be used
- Browse and Find modes.
Result You can use the Exit Script script step within the triggered script to return True or False.
- True: The event that triggered the script proceeds.
- False: The event that triggered the script is canceled.
- FileMaker Pro 10.0
- The trigger will fire regardless of how the object is formatted.
- If the object is set to not allow entry, the script can only be triggered if the object is entered using a script step.
- The OnObjectEnter, OnObjectExit, and OnObjectKeystroke script triggers can be activated when assigned to summary and calculation fields.
- Clicking into a different portal row will activate the OnObjectExit script set on the row being exited and then the OnObjectEnter script for the new row. As with OnObjectExit script triggers assigned to other objects, the script trigger is activated before the exit occurs, and the script determines whether the exit is successful based on the script result.
- Scrolling does not make the object active and does not activate this script trigger.
- See Changing object data without activating script triggers for a list of other actions that do not activate this script trigger.
- OnObjectExit will not activate from a portal in Find mode.
One way to help remember is to use the headings as keys:
- When does it trigger?
- When does the attached script run?
- Which modes will it work in?
- What are the possible results? And can you capture the results to further influence the outcome?
- What gotcha’s are there?
Finally, study and apply in a variety of situations.