SeedCodeCalendarPro

Deleting Records

Overview

We’ve put some structures in place to prevent the accidental deletion of the interface records which help draw the calendar. Most developers can just ignore ths whole issue, but if you’re building your own custom menus in the calendar you may want to read up on this.

We’ve endeavored to do this in such a way that we can leave the software unlocked, and interfere with basic FileMaker functionality as little as possible. Should one wish to remove the status area or remove all menu commands, there are certainly other methods one could use to accomplish these goals.

In this template we’ve chose to protect records with a Custom Delete Menu which calls our delete script instead of FileMaker’s default delete command. While we set this up to prevent the accidental deletion of our calendar’s 6 interface records, you can use this technique to protect other records by extending the scripts below. We also use this to remap the “New Record” command so your don’t accidentally create new interface records: see “Reset” in this documentation for more info on why we need to prevent this.

Protecting Records with a Custom Delete Menu

The SeedCode Calendar file loads a Custom Menu on startup. This is done in the file’s “Upon Opening” script. This custom menu, called “Scripted Deletion” differs from the standard FileMaker menus in only 2 respects: the “Delete Record” and “Delete All Records” steps are mapped to our own scripts so that we can prevent deletion of calendar interface records in some cases.

You can change the behavior of these pre-deletion tests by editing the script “Delete” and simply replacing the whole thing with the Delete Record script step.

Note that this custom menu completely maps the native FileMaker delete to our scripts: that includes the delete keyboard shortcuts and the toolbar’s delete icon. All of these now call our delete scripts.

Editing the Custom Menu

You’ll need FileMaker Pro 8 Advanced (FM8A) to edit the custom menu directly. However, since the menu really just calls a couple of our scripts, you can edit the script to effectively alter the delete behavior this menu imposes: you don’t need FM8A to do this. The script is called “Delete” in the case of the “Delete Records” menu item, and “Delete All” in the case of the “Delete Found/All Records” menu item.

Turning off the Custom Menu

If you wish to simply revert to FileMaker’s default menu set, you can do this by editing the Upon Opening script so that the “Install Menu Set” script installs the “Standard FileMaker Menus” instead of our menu set. Then run this script by hand or by reopening the file to reset the menu (you do not need FM8A) for this.

(855) SEEDCODE
[email protected]
Follow us: