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

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

Recommended Posts

Posted

There is a way to select a value from a value list and activate a script from the selection. My problem is that currently this is not working for me. I have done this before but for some reason my value list is not working correctly. The [text field] "payment_type" is linked to the [valuelist] "payment_type" and I have specified the field to perform my script. In the [valuelist] "payment_type" is a listing of values: CASH, DEBIT, VISA, MASTERCARD, DISCOVER and OTHER. I have two other fields that are involved in this script. [number_field] "payment" and [number_field] "credit_card"

Below is how I have my script written.

Go to Field "payment_type"

if ["payment_type = "VISA"]

Set Field [ Credit Card, Payment * .03]

Else

if ["payment_type = "CASH"]

Set Field [ Credit Card, 0]

Else

if ["payment_type = "DEBIT"]

Set Field [ Credit Card, 0]

Else

if ["payment_type = "AMEX"]

Set Field [ Credit Card, Payment * .03]

End If

End If

End If

End If

When I click on the [text_field] payment_type I get a message "This field is Not Modifiable". After I click on the OK, then the Value List shows up. I select the name "CASH" but the script does not activate. What am I doing wrong?

Posted

First of all, let's clean up the script. Instead of all the "if" statements, try this:

SetField(CreditCard)

Case(payment_type="VISA", Payment * .03,

payment_type="CASH", 0,

payment_type="DEBIT", 0,

payment_type="AMEX", Payment * .03)

Now you only have one SetField command.

My guess is that the error message you get has to do with the script saying GoToField. I'd add a Pause step after GoToField, then attach the script to the field in the Format:Button menu. That way, you'll get the popup list for the field, select the value you want, then you'll have to continue the script, but it'll work.

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