SeedCodeComplete2

Script Triggers

What kinds of layout based script triggers are in use?

Many layouts in Complete have an OnLayoutEnter trigger attached to them, and these triggers are trying to accomplish one or more of these three things:

1. Determine if the layout should be shown with or without the side bar. So you'll see simple layouts like "Contacts" calling the "Show Side Bar by Preference" script. You can set this side bar preference, by the way in the script "Load Settings - On Startup --- Edit Configuration Here ---"
2. The calendar layouts employ this script as well, but call it from within their own OnLayoutEnter triggers which manage the calendar's refresh.
3. Some special layouts have triggers to make sure global variables are set or cleared as you move from record to record. So you'll see the Projects layout has an OnRecordLoad script trigger as well to manage these processes.

Finally, all "real" layouts (not printing layouts or mini-windows) are running an OnLayoutExit script trigger that feeds the back and fwd system.

Can I turn script triggers off?

You can certainly turn off individual triggers by setting them not to operate in browse mode.

This keeps the trigger tied to the object in case you want to turn it back on later. If you haven't done this before, check out the section on Script Triggers in FileMaker's built in Help.

You can also temporarily disable triggers by setting the variable...

$$sc_ScriptTriggers_Off

... to 1. Just be sure to set it back to "" or 0 when you're done. You can see an example of this in the script "Collapse Side Bar ( Action )"

Note that we also have a nice script you can call that will stop layout-based script triggers. You'll likely want to preface any new scripts you assign to layout based triggers with a call to this "Halt Layout Based Script Triggers" script. This stops the script is the layout is drawn off screen or has a name other than the solution's main window name. For an example of this, see the beginning of the script "On Project Record Load".

(855) SEEDCODE
[email protected]
Follow us: