Skip 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.

Perform Script Based on Text Value

Featured Replies

Is there a way to perform a script based on resulting text from a drop down menu?

Ex: if a drop down menu results with the text "Refinance", perform said script. Otherwise, do nothing.

I can't use a button for the Field, being that it is a drop down menu (there are other text results that I don't want a script performed) and I don't personally know if there is a way to make it an auto-calculation to run a script based on the drop down result. Any ideas?

I don't personally know if there is a way to make it an auto-calculation to run a script based on the drop down result.

Well I know you can't ...unless you install an event trigger plugin. But it could be that hardly would need it anyway. What is the script doing??

Checkout: http://www.newcenturydata.com/downloads/checkbox_control.zip

--sd

Yes, you can but you need a plugin like, for example, EventScript.

You need to make this calculation as an AutoEnter/Replace calc of the field "text":

text &

Case(

S4HU_EventScript( Get(NomeFile) ; text ; "") ≠ "?";S4HU_EventScript( Get(NomeFile) ; text ; "");

""

)

If the field "text" contains a valid script name, the last will fire.

  • Author

Let me start by saying that the field name is "REASON". This field is a Drop Down with a Value list with many values.

This is the logic behind how I want the script to work (it isn't written yet):P If REASON = "Refinance", go to layout "Loan", otherwise do nothing.

I don't want the script to run if another value is selected from the drop down. It should only work if "Refinance" is selected. I know that didn't answer your question directly, but it was difficult to do that, since I don't know exactly how to solve the problem. Did that clarify the delima? I guess what I'm looking for is a way to imbed running a script based on a calculated value. (however, you're the master & I'm the grasshopper. I'm open to anything that will solve the problem I stated.)

  • Author

That's what I was afraid of. I've never used any Plugins before, but I guess I'll have to learn, eh? I'll look in to that and hold on to the calculation you wrote. Thank you VERY much for your help!

So you have to make:

1) A script Refinance:

Go to Layout ["Loan" (your DB)]

2) A value List that contains the word "Refinance"

3) A field REASON with this calc into the AutoEnter/Replace option:

REASON &

Case(

S4HU_EventScript( Get(FileName) ; REASON ; "") ≠ "?";S4HU_EventScript( Get(FileName) ; REASON ; "");

""

)

Edited by Guest
correction of the get(FileName) function

  • Author

That should do the trick! Writing the script wasn't the problem. What you cleared up for me was the calculation issue...which was that I need to get that plugin. After getting the plugin, I probably would have come right back to find out what to do with it, but you answered that too. You've been a huge help. Thanks again!

  • Author

Quick question about your script (forgive my ignorance)...

1. Does Get(NomeFile) mean the Table, The actual Database file name or the script name?

2. What is supposed to be typed in place of "?" (field name? Script Name? etc.)

Thanks.

1) Get(FileName) is the right function to call there ! That was a mistake due to my copy of FM that is setted for Italian language

2)Inside those "" can be placed a parameter to pass to the script. It can be reached with the Get(ScriptParameter) function

  • Author

Cool, Thanks!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.