Skip links

Prevent field jump in FileMaker after script trigger

10 tips and tricks for working with gFM-Business

Quick tipToday, many actions within FileMaker databases are performed with the help of Script-triggers. A typical example of this within documents is a field for entering the desired payment method, which is triggered with a Script trigger sets some other fields, such as due date or direct debit date, to the correct values after leaving the field, depending on the default in the payment type.

For this purpose, a script trigger is set up, for example "OnObjectValidate" or "OnObjectSave", which calls a script for the automatic entry of the desired data in the other fields. However, if the field with the script trigger is regularly in the tab sequence, FileMaker automatically places the cursor in the next field of the tab sequence after calling the script trigger and executing the corresponding script. In portals, FileMaker usually automatically jumps to the next related data record.

The field has not yet been left

In your script that was called by the script trigger, you can also integrate any commands for saving the data record, but these have no effect on the automatic jump to the next field or the next related data record. This is because FileMaker has not yet left the corresponding field after the script has been executed by the script trigger. For example, if you set the script trigger "OnObjectValidate" or "OnObjectSave", FileMaker executes the triggered script at the moment of validation or saving. After execution, FileMaker returns to the original field and does not leave the field until the script has been executed.

Script result '0' cancels all scripts

The solution to this problem is simple, you just have to figure it out first. In your script, which is called by the script trigger, add the command

Exit current script [Result: 0]

Exit current script: Specify script resultis added. It is important that you specify 0 as the script result, because this script result automatically cancels all further processes and FileMaker no longer automatically jumps to the next field or the next related data record.

Leave a comment

Share this page:

ERP software as flexible as your company.
We will be happy to advise you.

Customizable ERP software for Mac, Windows and iOS.

You are here: Prevent field jump in FileMaker after script trigger