Did That Just Break?

Did That Just Break?

When something breaks in the forest, does it make a noise?

When something breaks in a FileMaker database, does it log an error?

The Problem

When moving code around, patching files, or generally copy + pasting stuff from A to B, it’s quite easy to break things.

import.log file

The Good

FileMaker tries to help in the form of the import.log file, which gets written to when you paste something in.

The circle of quality-control-happiness(*)

---
config:
  layout: dagre
---
flowchart LR
    You((You))
    FMP[("FileMaker
    Pro")]
    log[/"📄 import.log"/]

    You -. "1. Paste code"        .-> FMP
    FMP == "2. writes errors"     ==> log
    log == "3. discover errors"   ==> You
    You == "4. find + fix errors" ==> FMP

(*) …theoretical…

The Bad

  • 💢 Some things are not logged at all
    • Layout Objects
    • Custom Menus
  • ❓ Some things are logged, but not as errors
    • Custom functions
      • mentioned, but errors are not logged
    • Things that already exist
      • renamed, but not logged as errors
    • External Data Sources
      • automatically created, but not logged as errors
  • ⁉️ Some problems are logged, but are unimportant
    • Errors in cancelled imports can distract
  • 🔍 Finding the error in the log is one thing
    • navigating to the errorneous object in the soluton is another problem entirely
---
config:
  layout: elk
---
flowchart LR
    Paste["⌘V
    Paste
    code"]
    File[("MyFile.fmp12")]
    FMP[("FileMaker
    Pro")]
    log[/"📄 import.log"/]
    NONE[/"💢 NONE"/]

    Paste -.-> FMP -.-> File

    File --> VL["Value Lists"]
    File --> TAF["Tables & Fields"]
    File --> SCR["Scripts & Steps"]
    File --> EDS["External Data Source"]
    File --> THM["Themes"]
    File --> CF["Custom Functions"]
    File --> LAY["Layout Objects"]
    File --> CM["Custom Menus"]

    VL  -- ✅ logs errors OK                --> log
    TAF -- ✅ logs errors OK                --> log
    SCR -- ✅ logs errors OK                --> log
    THM -- ✅ logs errors OK                --> log
    EDS -. 🔶 logs, but not as an error     .-> log
    CF  -. ❌ logs, but *lies* about errors .-> log
    LAY -. ❌ no logging at all             .-> NONE
    CM  -. ❌ no logging at all             .-> NONE

And we won’t mention - let alone dream about - the things you can’t copy & paste in FileMaker. 😜

Import log

The Ugly

The import.log file is ugly.

  • It is hard to read.
  • It is hard to find the errors in.
  • It is so hard, that you mostly just don’t bother.

MrWatson’s Solutions

Three of MrWatson’s Tools come to the rescue here…

  1. fmLogAnalyser
  2. fmCheckMate
  3. fmIDE
---
config:
  layout: dagre
---
flowchart LR
    subgraph mrwatsons-tools[MrWatson's Tools]
        fmLA[["fmLogAnalyser"]]
        fmCM[["fmCheckMate"]]
        fmIDE[["fmIDE"]]
    end
    File[("MyFile.fmp12")]
    log[/"📄 import.log"/]
    ESC[/"cancelled imports"/]
    errors{"errors"}

    File -->  log
    File -.-> ESC
    File -->  EDS["External Data Source"]
    File -->  CF["Custom Functions"]
    File -->  LAY["Layout Objects"]
    File -->  CM["Custom Menus"]

    log   -- ✅ visualises         --> fmLA
    EDS   -- ✅ warns about        --> fmLA
    ESC   -. ✅ hides errors       .-> fmLA
    CF    -- ✅ CF analysis        --> fmCM
    LAY   -- ✅ Layout analysis    --> fmCM
    CM    -. 🔶 CM analysis        .-> fmCM

    fmLA  -- "names that Thing"      --> fmIDE
    fmCM  -- "[Go to Thing] Button"    --> fmIDE
    fmIDE -- "opens Thing in FM-GUI" --> errors

fmLogAnalyser

fmLogAnalyser

First and foremost you need fmLogAnalyser to help you make the most of the import.log.

fmLogAnalyser for Visualising the import.log

fmLogAnalyser Screenshot

fmLogAnalyser for Proving you are Right

fmLogAnalyser turns your errors into a to-do list.

Once you have meticulously fixed all the errors in the log and ticked them off, the big

OK

sign tells you you have no more errors.

Proof you have done your work right!

BugOff! Alarm

fmLogAnalyser for Active Bug-Hunting

Use fmLogAnalyser’s BugOff! Alarm to actively tell you when something has broken.

fmCheckMate

fmCheckMate

To catch errors in Custom Functions, Custom Menus and Layouts, we need a different approach, since the log is useless here.

fmCheckMate-XSLT

For this you’ll need fmCheckMate and the fmCheckMate-XSLT Library

fmCheckMate for Custom Function Analysis

…after you paste them in, but before you close the Custom Functions dialog,…

  • Copy the Custom Functions back to the clipboard
  • With fmCheckMate convert them to XML
  • Click [T] or press ⌘T to choose an XSLT transformation
  • Select the analysis function List functions that seem to be commented out
  • You get a list of suspect CFs

If the list is empty, you can go back and save the custom functions, and if not you can break off, fix the problems and repeat.

fmCheckMate for Layout Analysis

With fmCheckMate and the fmCheckMate-XSLT Library you can perform an instant analysis on any layout in your solution.

fmCheckMate for Custom Menu Analysis

I still need to implement that :D

fmIDE

fmIDE

for a Quick Fix

Finally, fmIDE cuts through the last problem by navigating you straight to the erroneous object.

Happiness is a double-helix of quality-control

There are indeed two circles of quality-control-happiness:

  1. The circle of quality-control-happiness for main, logged objects

    • Value Lists
    • Tables & Fields
    • Scripts & Steps
    • Themes
    • External Data Sources (passively)
     ---
     config:
     layout: elk
     ---
     flowchart LR
         You((You))
         FMP[("FileMaker
         Pro")]
         log[/"📄 import.log"/]
         errors{"errors"}
    
         You == "1. Paste code"         ==> FMP
         FMP == "2. writes some errors" ==> log
    
         subgraph mrwatsons-tools["MrWatson's Tools"]
             fmLA[["fmLogAnalyser"]]
             alarm[["Bug-Off Alarm"]]
             fmIDE[["fmIDE"]]
         end
    
         log    == "3. read by"      ==> fmLA
         fmLA   == "4. triggers"     ==> alarm
         alarm  -- "5. warns"        --> You
         alarm  == "6. calls 'Name that Thing' API" ==> fmIDE
         fmIDE  == "7. navigates to" ==> errors
         errors -. "in"              .-> FMP
         You    == "8. directly fix" ==> errors
    
  2. The circle of quality-control-happiness for secondary, non-logged objects

    • Custom Functions
    • Custom Menus
    • Layout Objects
     ---
     config:
     layout: elk
     ---
     flowchart LR
         You((You))
         FMP[("FileMaker
         Pro")]
         errors{"errors"}
    
         You == "1. Paste code"      ==> FMP
         FMP == "2. copy code back"  ==> You
    
         subgraph mrwatsons-tools["MrWatson's Tools"]
             fmCM[["fmCheckMate"]]
             fmCMX[["fmCheckMate-XSLT"]]
             fmIDE[["fmIDE"]]
         end
    
         You    == "3. convert to XML"              ==> fmCM
         fmCM   == "4. analyse XML"                 ==> fmCMX
         fmCMX  == "5. press 'Go to Thing' Button"  ==> fmIDE
         fmIDE  == "6. navigates to"                ==> errors
         errors -. "in"                             .-> FMP
         You    == "7. directly fix"                ==> errors