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.

activate scripts from a pop-up list/menu?

Featured Replies

My FM 5.5 file has a lot of reports. Currently users have to go to a report layout and use buttons to choose the report they want. I would much prefer to group the reports and have users choose the one they want from a pop-up list or menu. When they select an item from the list, the associated script would be activated.

A perfect example of what I am looking for is the "Jump To ..." menu at the top of the Right Brain forum on this site.

Is there a way for me to associate scripts with items in a pop-up list using FM? I have looked at lots of posts but haven't come across the solution. I can't be the only one who wants to do this. (Perhaps I am the only one who doesn't already know how!)

Thanks for your expertise -

Mary Z

Hi Mary,

You cannot directly call a script from a drop-down menu, but what you can do is use the drop-down menu for selection, then have a go button.

The script for the go button would be calling other scripts dependant on the contents of the field containing the drop-down menu.

So for example if the field was called ReportChoice and the drop-down menu contained:

Sales Report

Finance Report

Marketing Report

You already will have a scipt in place for each of these reports I presume, so the go button will call the correct sript dependant on the contents of ReportChoice...

If ["ReportChoice = "Sales Report""]

Perform Script [sub-scripts, "Sales Script"]

Else

If ["ReportChoice = "Finance Report""]

Perform Script [sub-scripts, "Finance Script"]

Else

If ["ReportChoice = "Marketing Report""]

Perform Script [sub-scripts, "Marketing Script"]

End If

End If

End If

Hope this helps

Ed

On Windows you can format a drop-down menu as a button and put a Pause/Resume Script [0:00:00] in your script after a Go to Field ["thatfield"]. Nothing will happen until a selection is made, at which time the script continues and you can easily use the resulting selection to determine the next appropriate step.

On Mac, you can do something similar, but I believe it requires looping until a selection has been made, instead of pausing. Lee will probably give you a more specific answer for that one. wink.gif

Thanks Queue, you learn something new everyday smile.gif

Time to go and make a few adjustments to a couple of databases I think!

Cheers

Ed

The paused looping script can cause as many problems as it solves (like, what if the user exits the looping script?). I prefer the simple "go" button myself, fewer things to go wrong.

Perhaps on Mac it's not so good then. On Windows a user can't exit it, so it works smoothly.

Well, if they click on a button that is set to "Halt" already running scripts, then every script gets stopped. Ditto for a script that uses the Halt Script step.

OK, maybe I'll stick to my Go button! Less chance of a problem occuring that way!

Cheers Vaughan

Ed.

  • Author

This did exactly what I wanted. It was especially helpful to have the script steps clearly detailed in Ed's reply. Thanks, Ed and all, for your collective wisdom!

Mary Z : )

They can't click on a button when a script has a drop-down menu activated. They can only make a selection or click out of the field, click Continue, or press Enter, which only leave the field with its original data and continue the script. That's why this works so nicely on a PC.

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.