Over 46,000+ Business Solution Developers Find answers, ask questions, and connect with our community of business solutions developers, business owners and partners.
Abstraction and Indirection in FileMaker
Mike Mitchell, President of Net Caster Solutions, presented at DevCon 2017 on what is one of the most difficult topics in FileMaker, Abstraction and Indirection in FileMaker. Difficult because it’s not easily explained. It’s very title is a bit (unfairly) off putting, but the content is important for any serious developer
A real life example
- Accept the name of a table
- Navigate to the appropriate layout
- Delete all records in the table (or uses Truncate Table)
- Returns to the original layout
- Passes back the result of the operation (success or failure)
DRY (Don’t Repeat Yourself)
Abstraction and Indirection in FileMaker means, in short, building re-usable code a developer can use, without change, across solutions. Which sounds very handy (it is!) but is very difficult to do in the FileMaker world due to the wonder – and curse – of context. This is also known as DRY: Don’t Repeat Yourself.
Mitchell’s work in this area is impressive and he has shared it with a free FileMaker example file, available to FileMaker Community members.
A second example covered in the video:
- Make a script that creates one or more specified related records in a table. Caveats:
- It must conserve relationship to current table
- It cannot use any explicit field names
- It cannot use any explicit layout names
- It must include error trapping
Grace Under Pressure
Mr. Mitchell displays considerable aplomb and grace under pressure starting at 25 minutes in his presentation: he successfully troubleshoots a broken demo script, a bonus for viewers looking for troubleshooting guidance. Skip to about 41 minutes for the solution if you are pressed for time, because you don’t want to miss the rest of his tricks:
- Navigation Menu trick to allow you to show the Layout Menu without the status bar showing
- Query the Virtual Schema via ExecuteSQL
- Know what to switch from external to internal storage when upgrading
- Identify and clear all global fields when solution closes
- Fetch ID and description values from any table
- Extract Environmental information for use in scripting or user feedback
- Where Am I – at 47 minutes
- Fetch data from all fields on a layout in JSON notation
- Extract a list of container fields across all tables (very handy at times): at 52 minutes
- Window Management (very modular)
An impressive list, to say the least, and a great bag of tools for your tool chest. And it’s worth the annual cost to join the FileMaker community just for the time you will save.