Creating an Action Items Menu Button on a Layout


FileMaker 10 and 11 Script triggers allow you to clean up your interface by condensing a number of script buttons into a single popup. Here is how to get rid of unsightly buttons on your main layout by condensing a bunch of scripts into a single Action button.

Source: FileMaker Advisor: http://my.advisor.com/doc/19582

1) Create a global field

wpid205-media_1252702651517.png

This field will hold the names of your scripts.

2) Make a value list of script names

wpid209-pastedgraphic-13.png

Add whatever scripts you want to have displayed in the Action item button.

3) Make a script that fires when the field is set to the script name.

wpid206-pastedgraphic-10.png

I added the Set Field back to nothing and the commit record step to refresh the layout, before running the script.

4) Attach the script to the field

wpid207-pastedgraphic-11.png

Place the global field on your layout. I added a little Action item icon next to it, to give the user a clue as to the fact that there is something there…

OnObjectModify

wpid208-pastedgraphic-12.png

I attached an OnObjectModify script trigger to the field. Whenever the field is changed, the Action script will run, and select the correct script to run.

Note Red Star on Field

wpid1213-pastedgraphic-9.png

the little red star on the field indicates that a script trigger is attached to it.

5) Fire off scripts from a pick list without having to push another button.

wpid1212-pastedgraphic-8.png

One click actions. Note that I left the first line in the value list blank, so the user could chose to not choose, and back out without firing off a script.

Advertisements

3 Responses to “Creating an Action Items Menu Button on a Layout”

  1. If you use a free plugin like MyFMButler’s DoScript or 360’s ScriptMaster, you can perform a script by name which can make life a little simpler assuming you give your scripts intuitive names and you can eliminate the long IF statement. Just a quick tip!

  2. Good tip. Thanks Denis. I still tend towards not using plugins unless I really need them. I have seen too many free plugins die over time. Because they lack a revenue stream, there seems to be little incentive to keep them up long term. That said, it seems like ScriptMaster may have a sustainable long term model—development revenue and now a supported option.

  3. I had to use OnObjectValidate trigger for this to work. OnObjectModify was recalling the previous value entered. Perhaps this is bacause I passed scriptparameters to the equivalent of your master script, rather than read the value of the gScriptToRun field.

%d bloggers like this: