Custom Menus

FileMaker's menus are all about power. Through them, you can controland limityour users' access to the whole feature set. As the developer, you need all those commands to do your design and development of your database, but there are plenty of commands that give too much power to your users, particularly folks who don't much computer experience or who aren't shy about experimenting with commands…even if they aren't sure what might happen at the other end of a dialog box.

Brand new to version 8 is the power to customize FileMaker's menus. You can remove the Delete All Records and the Replace Field Contents commands for all your users, or you can remove them only from certain users' privilege sets. If you're the type of developer who likes to take charge of the user interface (see the box on Section 14.6.5, Custom Menus are your dream come true.

Here are just a few of the things you can do:

You can create and edit Custom Menus only in FileMaker Advanced, but anyone can use them with FileMaker Pro or in a runtime version of your database. These menus don't transfer to files you publish on the Web, though (Section 18.2). When you create Custom Menus for a database, be sure to provide a User Guide or similar documentation explaining what your custom commands do.

You can use Custom Menus to supplement, and even go beyond, privilege set features. For example, if you want to limit data entry people to using the copy and paste buttons that run your scripts, remove the Edit menu for users with that privilege set. They won't be able to use keyboard shortcuts to cut, copy, or paste. Removing the View menu prevents the Mode pop-up menu, toolbar, and all related keyboard shortcuts from working. (But you'll need to do some work providing replacement commands in your buttons and menus.)


Note: As powerful as Custom Menus are, they're no substitute for good security practices, as discussed in Chapter 16.


19.6.1. Editing a Menu

All new files you create use FileMaker's standard menu set unless you tell them to use a custom set. Just as each new file contains three default privilege sets, you get one set of custom menus that you can edit to suit your needs. And as with privilege sets, some items are in brackets and cannot be edited or duplicated, but you're free to create new menus with the same name and customize them.

Your goal for this exercise in customizing menus is to remove menu items that might confuse your users. When people are just learning FileMaker, simplified menus are less intimidating than masses of unfamiliar commands. You can also help protect your database from damage by someone unwittingly choosing the wrong command. You start the process by editing the View menu so that only a few items show up.

  1. In FileMaker Advanced, choose File Define images/U2192.jpg border=0> Custom Menus.

Figure 19-11. You can reorder the items in the Custom Menu list with the "View by" pop-up menu. You can also click each of the four column heads to sort the list. Probably this window's most important item is the small pop-up menu at the bottom. You can do all the editing of custom menus you like, but unless you remember to switch to your custom set, you don't see any change in your file.

By editing menus to suppress items that might confuse those who haven't had indepth FileMaker training, you've made your database a friendlier place to work. But don't stop there: In the next section, you'll learn how to create menus that show lists of commands you do want people to see, like your scripts.

19.6.2. Creating a New Menu

Using the steps described in the previous tutorial, you can edit FileMaker's menus to your heart's content, renaming them, and deleting extraneous commands to make room for new ones. If you don't necessarily want to delete any existing menus or commands, or even if you do, you can always create additional menus from scratch.

  1. In Define Custom Menus, click Create. In the Create Custom Menu window that appears, choose "Start with an empty menu." Click OK.

    If an existing menu is similar to what you need, you can use it as a template when you create new menus. But in this case, you don't need any existing menu commands because you'll attach your scripts to a new menu. When you click OK, the Edit Custom Menu window appears, just as in Figure 19-12. This time, though, you won't edit it, you'll build the menu from the ground up.

  2. Type "Invoices" in the Custom Menu Name fields. Also type "Invoices" in the Override Title field.

    Since you started with an empty menu, FileMaker assumes you want a custom name. If you don't type a name, the word "Untitled" appears in your menu bar.

  3. Turn off the Menu Mode options for Find and Preview modes.

    You don't want your scripts run from either Find or Preview modes, so by telling the menu not to even show up in those modes, you're adding another layer of security.

  4. Click the Command button. In the Specify FileMaker Command dialog box, choose the "No command assigned" option above the list of available commands, and then click OK

    This action creates a new command, but doesn't use one of FileMaker's canned actions. You could use this method to build a new menu that picks and chooses from various default menus, but in this instance, you're going to run your scripts from the new Invoices menu.

  5. In the Title field, type Create invoice for unbilled expenses, and then click Specify (to the right of the Action pop-up menu). From the list in the Specify Script Options window, choose the "Create Invoice for Job" script, and then click OK.

    The Specify Script Options shows all the scripts you've created in this database file. To add more scripts to this menu, repeat the last two steps until you've created new commands for all the scripts you want. The arrows to the left of each item let you rearrange them. Click the Separator button to create a divider line in the menu.

  6. Click the Menu Sets tab of the Define Custom Menus dialog box. If necessary, select "Custom Menu Set 1" in the list, and then click Edit.

    The Edit Menu Set window appears.

  7. Scroll through the list of Available Custom Menus until you see Invoices. Select it, and then click the Move button. Click the arrow to the left of the Invoices menu and move it up, so that it appears above [Scripts]. Click OK until you're back in your database.

    The Invoices custom menu is now a part of the new custom menu set and it appears between the Records and Scripts Menu.

So far, you've simplified one of FileMaker's menus and created a custom menu from scratch. Now you need to get rid of a menu that strikes fear even in the hearts of experienced FileMaker users: You're going to completely suppress the Windows menu.

19.6.3. Removing a Menu

At first glance through the Define Custom Menus dialog box, you might think that you just click an item in the Custom Menu list, and then click Delete to remove it. But you'll run into problems if you do. First, if you highlight menus with brackets around their names, the Delete button is inactive. And if you select an item where the Delete button remains active (Help), and then delete it, you get a nasty surprise when you click OK and return to your file. You see the text "Missing Menu" inserted in the menu bar, and the Help menu stays right where it was. Despite these obstacles, you can remove an entire menu; you just have to dig a little deeper to do it.


Tip: Troubleshoot a file for missing menu items by running a DDR (Section 19.3), or by checking Get ( LastError ) after you load a menu set in a script.


As mentioned previously (Section 1.7.2.1), the Window menu can cause problems for new users. For example, the Show command lists files that they may not know are open. Hiding and showing windows is also perilous for new users if they don't understand how FileMaker manages windows. Instead of bothering people with stuff they don't need to know, you can just suppress this menu entirely by removing it from the menu bar.

  1. In the Define Custom Menus dialog box, click the Menu Sets tab. Select Custom Menu Set 1, and then click Edit.

    The Edit Menu Set dialog box appears.

  2. In the Menus Set Name field, type "Data Entry."

    This descriptive name helps you remember the menu set's purpose. If you like, type additional information in the Comment box.

  3. In the "Menus in 'Data Entry'" list, click the [Window] menu. Click Clear, and then click OK until you're back in your database.

    Usually brackets on a list item indicate you can't delete it. But you can delete it from the display list, as you've just done. The [Window] menu remains in the Available Custom Menus list at left. If you change your mind, you can move it back into the display list to restore it.

Back in your database, the Window menu is gone entirely from the menu bar. This menu configuration is ideal for your data entry people, but not so great for administrative users, who understand the Window menu and use it all the time. Read on to find out how to tailor sets of menus for people with different privilege levels.

19.6.4. Installing Custom Menu Sets

FileMaker Pro Advanced lets you create a set of custom menus (see Figure 19-13) and use it as the default for a file, meaning that everyone who uses your database sees it, every time. But since the people using your database may have different levels of skill (and trust), you may want your custom menus to adapt accordingly. In fact, if you've read this book's chapters on layouts and privilege sets, you have all the tools you need to make the right menus appear to the right people at the right time. It's a simple matter of assigning menu sets to these existing features. You can conceal certain menus and commands from people who don't need them, but keep them available for everybody else. Or maybe you just want menu items to show up when they make sense for the active layout.

Figure 19-13. The field on the left lists the Custom Menus attached to the current set. Look in the list to see your edited View menu. The list on the right is a subset of the list on the left. Menus that aren't in the right-hand list are not displayed when this custom menu set is active. The Move, Clear, and Clear All buttons are similar to the ones in the Sort dialog box.

Once you've created menu sets using the steps outlined earlier in this chapter, you can install them in any of several ways:


Warning: Since you're effectively removing features for your users when you customize menus, thorough testing is a critical part of the process. Be sure to test menus with all affected layouts, privilege sets, scripts and across platforms. In FileMaker Pro Advanced, choose Tools Custom Menus to switch among sets as you test them.

Категории