January 4, 200620 yr I have a field called Activity. The field is formatted with a pop up menu containing 4 choices. The 4 choices coincide with layout names. What I would like to happen is: Upon data entry, the user selects "papers" from the pop up menu, he will then be directed/rerouted to the "papers" layout. If the user selects "presentations", he will be directed/rerouted to the "presentations" layout, etc. I have downloaded the EventScript plug in but I cannot figure out how to make it work. Anyone? :
January 4, 200620 yr Try something like this. You will need to have your value list (Papers, Presentations, etc) You will need to have a [color:blue]global field called: gActivity You will need a script called: SwitchLayout and then in your field gActivity, use this script to envoke the plugin. If ( Get ( ActiveFieldName ) = "gActivity" and S4HU_EventScript (Get ( FileName ); "SwitchLayout"; "" ) = ""; gActivity; gActivity ) Then in your your script SwtichLayout, you can have a If statement like: If gActivity = "Papers" Go to Layout [papers] Else If gActivity = "Presentations" Go to Layout [presentations] ... End If
January 4, 200620 yr One more thing. I think this post may belong in the Plugins section rather than the ScriptMaker forum. Mod, can you move this thread if you agree?
January 5, 200620 yr Author It looks so simple but it doesn't work. I noticed a change in your post. The first (gActivity) script you showed gives me errors: "(" don't match if the If the "IF" is gone, if I leave the "IF" the table cannot be found. mr_vodka's orginal script: --If ( Get ( ActiveFieldName ) = "gActivity" ; If ( S4HU_EventScript ( Get ( FileName); "SwitchLayout" ; "" gActivity; gActivity ) ; gActivity )-- When I try to use the changed script the table still cannot be found. Try something like this. You will need to have your value list (Papers, Presentations, etc) You will need to have a [color:blue]global field called: gActivity You will need a script called: SwitchLayout and then in your field gActivity, use this script to envoke the plugin. If ( Get ( ActiveFieldName ) = "gActivity" and S4HU_EventScript (Get ( FileName ); "SwitchLayout"; "" ) = ""; gActivity; gActivity ) Then in your your script SwtichLayout, you can have a If statement like: If gActivity = "Papers" Go to Layout [papers] Else If gActivity = "Presentations" Go to Layout [presentations] ... End If [color:blue][color:blue][color:blue]
January 5, 200620 yr Well I just shorted up the code from the original post and thought that I had changed it in time. It doesnt matter though which one you use. They both should work. However, the second one is much shorter. Try this attachment. EventScript_sample.zip
January 5, 200620 yr Author THANK YOU! It works. My mistake was not using a calculated value in the gActivity field. The attachment was a huge help. Thank you for putting it together so quickly. Happy 2006! Well I just shorted up the code from the original post and thought that I had changed it in time. It doesnt matter though which one you use. They both should work. However, the second one is much shorter. Try this attachment.
January 5, 200620 yr For the same purpose, I personally prefer to use this kind of calculation in the auto-enter option: // If the current active field is the navigation global If ( Get ( ActiveFieldName ) = "gActivity"; // Then do the auto-enter option AND trigger the target-script gActivity & S4HU_EventScript (Get ( FileName ); "SwitchLayout"; "" ); // Else, simply do the auto-enter option gActivity ) I found this one easier to read. : BTW, nice demo Mr. Vodka !!
Create an account or sign in to comment