Blog

Script Triggers Drawn Out

By October 22, 2012 5 Comments

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.

Mislav Kos

Mislav Kos

Mislav is a FileMaker developer and a Technical Solution Architect at Soliant Consulting.

5 Comments

Leave a Reply

Need to adjust your business processes quickly? We're helping clients use technology to keep their teams productive and running smoothly in these times of uncertainty. Our team can guide yours if you need help in these areas.

Talk to a Consultant