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

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

Recommended Posts

Posted

Is it possible to trigger a script based on a string from a Drop-down list value in text field?

In my Drop-down list, and from two of the listed text values in that list, when I have chosen the value, I would like to set a date field manually. I was thinking the script should open a Show custom dialog? Will it work some how, or maybe something else?

Posted

Your question is not entirely clear.

You can trigger a script to run when the field is modified. The script will run no matter which value was selected from the drop-down list. You can have the script branch according to the chosen value.

Posted (edited)

I had some problem to have the script be trigged on a PC, but it trigged on my Mac, using OnObjectModify. Using this script in the attached file:

If [ GetField ( Test1::Value_List_Field = "Value2"  ) ]

    Show Custom Dialog [ "In data" ;  "Your date" ; Test1::Relevant_Date_Field ]

End If

 

It seems like I'm using the wrong function because it triggers the script no matter which value is selected. I'm wondering if the GetField function evaluates the whole value list, and thus trigger script anyhow.

   

Test_ValueList.fmp12

Edited by snekkis
Posted (edited)

First, you have misplaced the closing parenthesis of the GetField() function. What you wanted to write is:

If [ GetField ( Test1::Value_List_Field ) = "Value2" ]

But in truth you don't need the GetField() function at all; you can write simply:

If [ Test1::Value_List_Field = "Value2" ]

Use the GetField() function when the field's name needs to be determined dynamically at the time of evaluation.

 

Edited by comment
  • Thanks 1

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