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.

Problems with Script Triggers

Featured Replies

Hi,

I've been trying to use a script trigger attached to the last data entry field on a layout to jump to the next layout in a series and the script is behaving strangely and I thought I might ask the forum for some advice.

I have the following script attached to the (second) layout (that normally runs without any problems on layout enter) which sets some variables and then goes to the first field on the layout

Set Variable [ $$Current Measure; Value:If .....

Set Variable [ $$Measure Context; Value:If ( PatternCount.....

Set Variable [ $$Measure Timepoint; Value:Neuropsych Sessions::pfk_Administration Timepoint ]

Set Variable [ $$Measure Session; Value:Neuropsych Sessions::ppk_NP Session Number ]

Set Window Title [ Current Window; ......

Adjust Window [ Maximize ]

Refresh Window

Go to Next Field

However when I set the following script to run on LayoutKeystroke (attached to the last field on the first layout) the second layout loads fine, but then the active field jumps from the first field to the SECOND field on the layout...nothing I seem to do will change this behavior. I'm positive that this has something to do with the fact that I'm hitting the enter/tab/return key on the previous (first) layout once and its somehow being carried over to the next (second) layout as the second layout loads. If I change the settings for the first field (on the second layout) so that "go to next object" no longer works with return, then go back to the first layout and hit return to exit the last field the script works fine---I don't jump to the second field as I switch layouts---- (but i here the mac "bonk" noise that means a key was pressed that won't do anything).

If [ Let( keyCode = Code( Get ( TriggerKeystroke ) ); keyCode = 9 or //Tab Key keyCode = 10 or // Enter keyCode = 13 // Return)]

If [ not IsEmpty ( Get ( ActiveFieldContents ) ) ]

Go to Related Record [ From table: “Neuropsych Sessions”; Using layout: (Get ( LayoutNumber) + 1) ] [ Show only related records ]

Go to Next Field

End If

End If

any advice would be greatly appreciated

Exit Script[False] will cancel the tab.

Put that inside an If[] statement (or calc it inside the script result).

  • Author

Exit Script[False] will cancel the tab.

Put that inside an If[] statement (or calc it inside the script result).

It works perfectly, you are a godsend!

thanks so much

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.