I would use the script step Install Menu Set in a script set to run on first window open.
If ( Get ( AccountPrivilegeSetName ) <> "[Full Access]" )
Install Menu Set - Custom, set as default
In Manage Custom Menus, you can select a default menu set for the file.
In layout mode, Layout->Layout Setup, you can select a default menu set for the layout.
There isn't a default menu set for a privilege set. The option you describe overrides custom menus, to allow access to all menus, just editing menus (cut, copy, etc) or pretty much no menus at all.
However, you can either use the "Install Menu Set" command to install the menu set appropriate for the current user or, as I would do, create one master custom menu and use "install when" to install only those menus and menu items appropriate to the layout, privilege set, extended privileges or whatnot.
As discussed in another thread, we used to have separate menu sets for different layouts and different script functions, but found it's much easier to manage one custom menu set that has all the commands but installs menus and menu items only when appropriate. I'd also recommend putting the "dangerous" ones in the custom menus, like delete all records, replace field contents, and all your "manage" items, but having them only install when the user is full access. This will keep you, the developer, from having to constantly put the custom menu set up and down.
If you want multiple sets of menus, pay attention to Chris' comments and use coherentkris' method, with a modification.
Assuming you've set up multiple privilege sets, create multiple Custom Menus. You can create as many as you'd like.
Using the startup script method, take full advantage of your opportunities.
If ( Get ( AccountPrivilegeSetName ) = "Managers" )
Install Menu Set - Managers, set as default
Elseif ( Get ( AccountPrivilegeSetName ) = "Workers" )
Install Menu Set - Workers, set as default
Install Menu Set - Admins
You don't need to go crazy and have one set of menus for each role in your solution. But having more than one isn't bad at all.
But having more than one isn't bad at all.
Good point. Don't confuse my preferences with hard and fast "rules".
I'm sure there are plenty of scenarios where multiple menu sets are easier to manage. For menu sets that are mostly similar, though, consider whether it might be easier to just manage variations in individual menu items rather than whole menu set copies. It's the same sort of decision that comes up when considering whether to add a new layout, table or even file for something that's very similar to something you already have. Sometimes a whole new element makes sense, but often there's an opportunity to manage small differences with a setting, like a hide when, or a type field, or some such.
We work almost exclusively with custom solutions for small businesses, where changes are frequent (small businesses have a tendency to always be growing and changing). Our focus is on making our development easily "extensible" (hence our name), so we're always asking ourselves questions like, "If the client asks us to change when the 'print' menu item shows, are we going to have to change this in one custom menu, or seven of them?" Because we keep this consideration top-of-mind during development, we've eliminated the need for a full time "clicker", whose job it was to "go make this change on every layout in these 17 files" and so forth.
But there I go with my preferences again. In the end, think through the tools and do what's right for the given situation. All generalizations are wrong, including this one.
I agree with everything you've said (at the risk of overgeneralizing).
I don't get your solution to work. Whenever I switch layout it goes back to the "default menu for this file". How can I make it stick?
I have one custom set which is the default for the file.
During the Open-script I do this:
If[Get ( AccountPrivilegeSetName ) = "[Full Access]"]
Install Menu Set ("[Standard Filemaker Menus]")
The standard set is choosen, but as soon as I switch layout it goes back to the Default set.
1 of 1 people found this helpful
There is an option in the Install Menu Set option to set the menu set as the file default.
If ( Get ( AccountPrivilegeSetName ) = "[Full Access]"] )
Install Menu Set ( "[Standard FileMaker Menus]" ; install as file default )
Install Menu Set ( "Menu Set for Everyone Else" ; install as file default )
*douh* I never saw the "Install as file default" option...