The Original FileMaker Community
Business Templates - Demo Apps - Video Tutorials -Samples - Help - 46000 Member Forum

The Leading Filemaker Developer Tools

Script Triggers in FileMaker 13 – FileMaker Today


There are quite a few nuances in how FileMaker script triggers function. Two of the more straightforward ones are the sequence that script triggers evaluate in (e.g. OnObjectKeystroke fires before OnLayoutKeystroke) and the timing of a script as compared to the event that triggered it (i.e. pre- vs post-event triggering).


 


For me, the difficulty with these two attributes isn’t comprehension; it’s memorization. I find myself looking this stuff up over and over again. So, to make it easier to remember, I mocked up the following diagram. Hopefully it has some use for you as well.


 

Script Triggers in FileMaker 13


 


Breaking this graphic down a bit…


 


There is a method to the order in which triggers fire:


  1. First there is the entering into the interface elements, which happens in the following order: file, window, layout, mode, view, record, object.

  2. Next is the interacting with the objects that have been laid out; e.g. a user types something, a script makes a field active, etc. Each of these script triggers deals with objects (except for OnLayoutSizeChange, OnGestureTap and OnLayoutKeystroke).

  3. The “transaction” is completed with the leaving of the interface elements, which happens in reverse order: object, record, view, mode, layout, window, file.


I’ve marked the post-event actions in red to connote a sort of warning, since FileMaker does not allow us to cancel these triggering events.


 


A comment on the differences between FileMaker 12 and 13:


 


FileMaker 13 introduced two brand new triggers and a change to one of the existing triggers:


  • OnLayoutSizeChange – mostly targeted towards iOS, but also fires when a window is resized in Pro, including as a result of showing or hiding the status toolbar

  • OnGestureTap – iOS only; remember that it also fires even when you tap a button or tap to enter into a field

  • OnPanelSwitch – replaces OnTabSwitch to account for the new slide control (slide panels are akin to tab panels with respect to the OnPanelSwitch trigger)


Wim Decorte’s Script Triggers PDF Reference and Test File


To learn more about each of these triggers, take a look at Wim Decorte’s updated PDF reference and .fmp12 test file (download it here).


(The FileMaker 12 version of these two files appeared in Kevin Frank’s post back in July 2012.)


On the face of it, script triggers are fairly straightforward. But there are nuances and non-obvious considerations to each one. Wim’s color-coded PDF reference provides notes that highlight these subtle variations.


For instance, did you know that the OnLayoutSizeChange trigger won’t run in Preview mode? Here’s another exampe: if you drag & drop data into an inactive field, the OnObjectModify trigger will not fire for that field even though its content will have been modified.


The test file demonstrates the firing order and behavior for each trigger. Open it in Pro, Go, and in your web browser (via WebDirect) to learn how triggers behave in different clients. The layout contains every conceivable type of object, so that no stone is left unturned.


Since all possible events are configured, the tool is great to see the exact sequence of events on any number of actions such as moving between fields, moving between records, switching between tabs or panels, opening up a pop-up, etc.


Script Triggers in FileMaker 13

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy