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

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

Recommended Posts

Posted

This should be a quickie... If a user selects a choice from a value list, how can I trigger a script to run based on the user's choice? Much thanks!

-Scott

Posted

You must have a separate button to run the script. If you attach a script to a pop-up list or any datafield the first thing that happens when you click on it is that the script is executed. This precludes the possiblity of selecting a value first and then executing the script associated with the selected value. What you can do is have the script button execute a script that interrogates the contents of the datafield and then perform a subscript based on the value of the contents. i.e. let's say you have a datafield called Field1 that is formatted as radio buttons and the value list connected to the field has values ONE, TWO, THREE, FOUR.

You can change the contents of the datafield by clicking on one of the values that in the field. When you click on the script button it will execute a script, lets call it Fred. Fred looks like this

If (Field1 = "ONE")

Perform Script(sub-scripts,"Show One")

Else

If (Field1 = "TWO")

Perform Script(Sub-scripts,"Show Two")

Else

If (Field1 = "THREE")

Perform(sub-scripts,"Show Three")

Else

If (Field1 = "FOUR")

Perform Script(subscripts,"Show Four")

Else

Show Message ("Nothing Selected")

End if

End if

End if

End if

Each subscript would do whatever you wanted it to do for the associated value in Field1.

If you attach the script to the datafield you will never be able to change the value in the datafield before executing the script.

The Mad Jammer

Posted

You may want to play with some plug-ins now with version 7, or use some other ways...

Here's an alternative using a repeating field to mimic a value list and JM. Osborne Visibility technique.

It has a 250+ Value list which obviously isn't a reasonable solution, but working with a 10-15 items would be easy I'd think.

ClickAndGo.zip

Posted

You don't need a separate button. The first part of your script merely needs to go to the field and pause. On Windows, make the field a menu and attach a script like

Allow User Abort [Off]

Go to Field [yourfield]

Pause/Resume Script [0]

If [yourfield = 1]

Perform Script [One]

Else If ...

End If

For Mac, the solution is similar, but requires using a list, a loop and an Exit Loop If [not IsEmpty(yourfield)] step.

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