Innovative Data Solutions

How to avoid script triggers ruining your day

Script triggers are your best friend and worst enemy. They are great when they trigger as required but not always so good when you don’t want the scripts to run.

For example when opening a new window, if you are on a layout with ‘on layout load’ or ‘on record load’ these scripts will run. This can be unhelpful if all you want to do is go to another layout set some fields and close the window.

Here are two ways to avoid the pain.

You can stop using the New Window command and replace it with Goto Related Records. Create a relationship based on the primary key, Goto Related records with ‘match all in found set’ checked going to a layout without any triggers.

or

Have a $$Variable which is checked at the start of the scripts to be triggered.

If ( $$Variable = “Exit”)

Exit Script (true)

EndIf

On the script which is opening the new window set $$Variable to “Exit” at the start and blank at the end and the scripts will be triggered but instantly finish.

The only down side to Option one is more relationships

The only down side to Option two is you have to Set $$Variable to blank at each point the running script could exit.

Simon Ward

About Simon Ward


Simon has been developing FileMaker databases since the late 90s and joined Linear Blue in 2006. Over this time he has developed database systems for clients in many different industries from Order Processing to Book Publishing. Simon’s BSc in Chemistry from Thames Valley University comes to the fore in his analytical skills and he is certified in FileMaker versions 7 through 11.

One Response to How to avoid script triggers ruining your day
  1. murugan
    November 19, 2009 | 8:17 am

    very useful article.. nice work

Leave a Reply

Wanting to leave an <em>phasis on your comment?

Trackback URL http://www.linearchat.co.uk/2009/10/how-to-avoid-script-triggers-ruining-your-day/trackback/