Script Triggers Drawn Out

1/27/14: Check out the updated version of this post (updated for FileMaker 13).


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.

Diagram

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: 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 changes some data, etc. Each of these script triggers deals with objects (except for the OnLayoutKeystroke).
  3. The “transaction” is completed with the leaving of the interface elements, which happens in reverse order: object, record, view, mode, layout, window.

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.


Update: I updated the graphic because the original one had the OnFirstWindowOpen and OnWindowOpen triggers backwards, with respect to the pre/post-event firing. Same goes for the OnFirstWindowClose and OnWindowClose triggers.

5 thoughts on “Script Triggers Drawn Out”

  1. Pingback: FileMaker13のスクリプトトリガ | Not Only FileMaker

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top