OnObjectEnter FileMaker Script Triggers And Portals

From Dwayne Wright PMP
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

Please Note: If you are viewing this page in a news feeder, the images may get munged up a bit. For the best experience, please visit the journal directly by clicking (here). 

The OnObjectEnter script trigger will fire when the layout object it has been applied to becomes active, most likely by a mouse click, keyboard tab action, scripted action or if that field is first in the tab order when a new record or new find request is created.

A portal is a layout object and is also one of the few layout objects that can contain multiple layout objects. That is to say the portal can have objects within it (such as fields) and the instance count of those objects goes up with every related record that portal displays. Doing the math, a field with the OnObjectEnter trigger within a portal row can be displayed 6 times, one for each related record. So that one trigger becomes six triggers in browse mode.

Now lets recap, you can have an OnObjectEnter trigger applied to a portal, objects within the portal or both. The OnObjectEnter trigger assigned to a portal will fire whenever a different row in the portal becomes active. Objects within a portal are repeated for every related record they display and those objects can have the OnObjectEnter trigger applied to them.

What happens when a user clicks into a portal row field and both field and portal have an OnObjectEnter trigger assigned? The OnObjectEnter trigger assigned to the portal will fire first and the field OnObjectEnter trigger will fire second.
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2009 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.