Jump to content

activate scripts from a pop-up list/menu?


This topic is 6529 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 6529 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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