Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script triggering on Record Load

Featured Replies

I'm working in Filemaker 9, so can't use the OnRecordLoad trigger in FMP10.

I'd like to use Scriptmaster's Call Script Immediately module to run a script when a record loads, (so I can select a particular tab on a tab object depending on a field value on the record)

I can't see where to define the appropriate event condition for the Call Script Immediately module.

Am I missing something or is it not possible to select the event that you want the script to trigger on?

Thanks

Brian

Well your only option within the ScriptMaster modules is to specify the script to execute. To execute the script during the desired "event" you would need to execute the ScriptMaster function when that event occurs.

I think you should be able to use an unstored calculation, make sure that you have the calc on the layout with your tab control. But I'm not sure how reliably this would work.

  • Author

On your website, it describes Call Script Immediately as:

"This immediately calls a FileMaker script (scriptName) in the current file. You can use this to trigger scripts when field values change, when a tooltip is displayed, or any other time that FileMaker evaluates something in the calculation engine."

This suggests that the script triggers on any event when Filemaker evaluates anything in the calculation engine and therefore I can't choose a particular event. So if I were on a layout where I first clicked on a Tooltip, and then I changed a field value, the script called by Call Script Immediate would trigger twice. Is this correct, or is there a way of choosing just one of these events to trigger on?

In the meantime, I'll try and see if I can set up an unstored calc that will do the trick.

Thanks

Edited by Guest

You will have to investigate a way to do this... and it will not be easy.

To trigger the script, you don't need an unstored Calc, but you can place the calculation simply in a webviewer. The problem is that a webviewer is evaluated all the time ( if you enter a field, exit a field, if you click etc etc )...

So you will need to have something like this

Let (

_script = "TriggerScript ( "TestScript" )"

;

Case (

//find a way to see if a record is loaded

; Evaluate ( _script )

; ""

) //End Case

) //End Let

Check out these links for some more information on triggering scripts via a calculation:

http://www.softs4humans.com/FMPro_Plugins.html

http://www.myfmbutler.com/index.lasso?p=416

My point isn't to show you other plug-ins to use, but to show you the documentation that comes with those plug-ins. If you download the example files, they show you all the ways of running a script from a calculation.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.