The Original FileMaker Community
Business Templates - Demo Apps - Video Tutorials -Samples - Help - 46000 Member Forum

Our Preferred Cloud Hosting Provider

Abstraction and Indirection in FileMaker with Mike Mitchell

Mike's Session File Downloads Included

Get real time updates directly on you device, subscribe now.

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

Let’s make it real.  Mitchell’s first builds a script into which he passes one script parameter:  A table name.  From there, this is what the script will do :
  • 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)
Not bad, hmm? And this script is modular – easily portable between solutions without any changes.  Not bad…

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.

More Magic

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.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More