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.