Custom Menus

How are Custom Menus used in SeedCode Complete?

We usually include custom menus to add some new functionality to a menu. For example we've modified the File menu so that you'll see an "Import vCard" option if you view that menu from the contact's layout.

Note that Custom Menus can only be modified in FileMaker Advanced, but the scripts called by these menus (which is where the real work is done) can be edited in Pro or Advanced.

In Navigation

We use a custom menu to hijack the behavior of the Form, List, and Table buttons, so these run our script "View As ( Form ; List ; Table )" instead. This script is very easy to modify if you add a new table or section to SeedCode Complete.

Probably the most interesting use of Custom Menus in SeedCode Complete is in the creation of new records...

How is record creation scripted?

When you use a keyboard shortcut to create a new record, or select "New..." from FileMaker's Record menu, we're actually running a script to create the new record.

This is accomplished using custom menus but you don't need to edit the custom menus themselves to change and extend this behavior.

All you need to do is edit the script "New Record" and the subscripts it calls...

New Record. The script "New Record" decides which of the major tables we're on and then calls a record creation script specific to that table. So if we're on Contacts it calls "New Contact", if we're on the calendar it calls the script "new".
If the "New Record" script doesn't recognize the table we're on, it calls FileMaker's generic "new record" command and a new record is created. So if you're adding new tables to Complete, you don't necessarily have to add them to this script, since "New..." will continue to create new records anyway. You edit this script if you want to take a bit more control over the new record creation process. For example...
New Contact. This script doesn't really "do" anything but it's here in case you want to add some business logic, like tagging the newly created contact to the logged in staffer.
New Invoice. This script is a little more interesting in that it sets a few values we might normally expect to find in auto-enter calcs: setting these value here makes it easier to conditionally change what's happening and reflects our desire to separate the interface and data. You'll see that set the invoice date, the tax rate, and the invoice terms in this script.
New. This is the calendar's New Event script, and is one of the reasons we went with custom menus in Complete. Without them, if you were on the calendar layout and hit they keyboard shortcut for a new record you'd make a new record in the calendar's interface table. Not very useful. Using custom menus we can capture your user's intention and call the script "Create, Edit, Delete Event..." to create a new event record.

Filter the script list for "New" to see other examples.

Follow us: