Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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? :

Posted

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

Posted

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?

Posted

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]
Posted

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

Posted

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.

Posted

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 !!

This topic is 6899 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.