October 29, 20187 yr 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?
October 29, 20187 yr 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.
October 29, 20187 yr Author 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, 20187 yr by snekkis
October 29, 20187 yr 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, 20187 yr by comment
Create an account or sign in to comment