Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Trigger script from Drop-down list?

Featured Replies

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?

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.

  • 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 by snekkis

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

  • Author

That was it. Thanks!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.