snekkis Posted October 29, 2018 Posted October 29, 2018 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?
comment Posted October 29, 2018 Posted October 29, 2018 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.
snekkis Posted October 29, 2018 Author Posted October 29, 2018 (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 October 29, 2018 by snekkis
comment Posted October 29, 2018 Posted October 29, 2018 (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 October 29, 2018 by comment 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now