Jump to content
Server Maintenance This Week. ×

Trigger script from Drop-down list?


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

Recommended Posts

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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