Jump to content

Problems with Script Triggers

This topic is 4421 days old. Please don't post here. Open a new topic instead.

Recommended Posts


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

  • Like 1
Link to comment
Share on other sites

This topic is 4421 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

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