Level: Intermediate, Macintosh

Another Tip for MBS “Check Variable Names”

This is a quick follow up to A Tip for MBS “Check Variable Names” from earlier this year. The other day I noticed variable name checking wasn’t working in one of my scripts. The culprit turned out to be MBS’s default 500 step limit for variable name checking. According to the documentation, the limit exists for performance reasons, but it turns out it can be adjusted like so.

MBS ( "SyntaxColoring.CheckVariableDeclaration.SetLimits" ; 2000 )

As you can see, I’ve quadrupled the number of script steps that MBS will check. I don’t plan to ever write, or have to work on, a script this long, but you never know. At any rate, problem solved, and so far I have not noticed any performance degradation in the script workspace.

You can read all about this function here on the MBS web site — https://www.mbsplugins.eu/SyntaxColoringCheckVariableDeclarationSetLimits.shtml

Level: Intermediate, Version: FM 12 or later

Boxed Summary Groups for Reports

Demo file:  boxed-summary-groups.zip

Recently I needed to produce a summary report with variable height rows and each group enclosed in a rectangular box. To make the challenge more interesting, there were multiple fields in the body part, and it was not known in advance for any given record which would be tallest. At any rate, the approach I decided to go with took a bit of trial and error to get working and I figured I’d share the process here in case anyone else finds it useful.

Continue reading “Boxed Summary Groups for Reports”

JSON, Level: Any, Version: FM 22 or later, Virtual List

FileMaker Pro 22: Initial Impressions

Demo Files

Minimum version to open the file shown in parentheses.

Introduction

It’s been a couple weeks since the release of FileMaker Pro 22 (a.k.a. 2025), and now that the dust is beginning to settle and I’ve had some time to explore and build some demos, my initial reactions are…

  1. Wow, this is an amazing, game changing release.
  2. Ouch, they just “broke” a bunch of my blog articles — in the sense that behaviors and issues described therein have changed in FM 22.

What this article is not: a general overview. If you’re looking for a general overview Fabrice Nordmann (FileMaker 2025! Explore the New Features) and Wim Decorte (FileMaker 2025 Executive Summary) have written some good ones.

What this article is: a look at some of the features and fixes I’m interested in, including the new GetRecordIDsFromFoundSet (a.k.a. GRIFFS) function, and with particular focus on JSON performance improvements. Also I want to mention a potential problem if you’re on the Windows platform, and we might as well get that out of the way first. Continue reading “FileMaker Pro 22: Initial Impressions”

Level: Intermediate, Version: FM 12 or later

Magic Numeric Value List

Demo Files

Demo #2 is a variation on demo #1, and uses the contents of a $$variable as the basis for the value list.

The Challenge

Recently I had a need to use a dynamically-generated ascending sequence of numbers as the basis for a value list, and in a multi-user-safe manner. By dynamically-generated, I mean that the list of numbers would be calculated at runtime and would not be known in advance. And by multi-user safe, I mean the methodology would need to allow multiple users to simultaneously and independently populate the value list with their own sets of numbers.

First Attempt At Solving

There are a number of ways a developer might go about solving this problem, and my initial plan was to…

a. Populate a global text field with the list of numbers

b. Base the value list on that global field using a technique I picked up from John Ahn at DevCon 2012 in Miami Beach (as described in Magic Value Lists) and which I subsequently explored in detail in Custom Field-Based Value Lists.

The basic idea is to set up a relationship where the “primary” predicate is unstored. In this case I went with a self-join from my Settings table to itself like so…

…though I could have instead used a global field on the left (primary) side… the important things being that the left-hand predicate is not stored and the right hand predicate is stored, and of course that the relationship is valid (in this case we have an equijoin operator and each field = 1).

[Note: a Cartesian join relationship would work here as well.]

Continue reading “Magic Numeric Value List”

Level: Intermediate, Version: FM 21 or later

Closing Windows During Transactions

Update 2 Aug 2025: the issue documented in this article has been resolved in FM 22 (a.k.a. FM 2025).

This article documents behavior in the current shipping version of the product, i.e., FM 21 (a.k.a. FM 2024).

Demo file: transaction_test.zip (requires FM 21 or later)

This is a follow-up to last month’s article on Modal Transactional Card Windows to address a very specific question. Given that transactions are scoped to a window, does a transaction properly revert when you close the window where the transaction was initiated?

At first glance it would appear that the answer is yes, but appearances can be deceiving, and today we have a demo file from Jonathan Jeffrey that can help us understand what is actually going on, and which I am sharing with his kind permission. Continue reading “Closing Windows During Transactions”

Claris Pro, Level: Intermediate, Version: FM 20.2 or later

Modal Transactional Card Window

20 April 2025: Demo and article updated to incorporate a couple tactfully-worded suggestions from Tony White to make the technique more robust. Thank you Tony.

Demo file: transactional-card-window-v3.zip (requires FM 20 or newer)

Resources

Introduction

Recently a colleague and I were discussing ways one might go about having a card window be both modal and transactional. By default card windows are modal to the “background” window (the window they were generated from), but are not modal to other windows in your solution.

In this case we wanted the card window to be modal to the entire solution, so that once it was displayed the user would not be able to do anything else in FileMaker Pro until they had dealt with that window.

Additionally we wanted to leverage the transactional model, so that edits would take place in standard fields, with changes made by the user committing if they clicked Save, and evaporating if they clicked Cancel. Reminder: transactionality is an all-or-nothing proposition. You either get all your changes or none of them. You never end up with half baked data.

And, finally, we wanted to map the Esc key to the Cancel button, and map the Return and Enter keys to the Save button. Continue reading “Modal Transactional Card Window”

JSON, Level: Advanced, Version: FM 21 or later

JSON Optimization in FM 21

Introduction

If you work with large JSON structures in FileMaker, you may be aware that the current shipping version of the product (FileMaker Pro 21, a.k.a. FileMaker Pro 2024) has a single-element JSON cache, which is reset whenever JSONSetElement or JSONGetElement is called, and that you can boost performance by taking this into account.

Six months ago Josh Halpern was kind enough draw my attention to this in a comment on one of my articles, and added…

“If you’re interested, I wrote a couple more points about how the JSON cache behaves here: https://the.fmsoup.org/t/performance-core-principles-10-scripting/1867/25?u=jwilling. But the gist is… only touch one json at a time.

[The above is required reading as far as I’m concerned, and has changed the way I work with JSON.]

More recently I was discussing JSON caching with Steve Senft-Herrera, and he shared a couple additional optimization ideas that had not occurred to me, and that I am definitely adding to my tool kit. (Thank you Steve.)

At any rate, today we’re going to take a look at applying all three of these ideas to speed up processing of large JSON structures within a While statement, and you can follow along in today’s demo file if you are so inclined.

Demo file: fm-21-json-optimization.zip  (requires FM 21 or later)
Continue reading “JSON Optimization in FM 21”

Level: Intermediate, Macintosh

A Tip for MBS “Check Variable Names”

7 Aug 2025 – See also Another Tip for MBS “Check Variable Names”

If you’re on MacOS, and use the Monkeybread (a.k.a. MBS) plug-in with “check variable names” enabled, you quickly come to appreciate how useful this feature, also known as linting, can be.

For example I recently helped another developer track down a script problem that turned out to be a slight misspelling of a variable name, a misspelling subtle enough that it took us a long time to see it (of course for most of that time we didn’t realize the $var name was the culprit). If he’d had Monkeybread installed and this feature turned on, we’d have saved about 45 minutes. Actually I shouldn’t say “we”… my colleague would have immediately seen the problem and wouldn’t have bothered to contact me. Continue reading “A Tip for MBS “Check Variable Names””

JSON, Level: Advanced

January 2025 FM Training Livestream

Here are links to articles, custom functions, etc., related to my Wednesday, January 15th FM Training Livestream presentation on JSON custom functions.

YouTube link

Demo Files

JSON and JSON Custom Functions

Other JSON-Related Articles

JSONQuery

 

JSON, Level: Advanced, Version: FM 19.6 or later

JSONQuery Odds and Ends

This is a quick “odds and ends” post to share the current iteration of my JSONQuery sandbox file. Some of the examples are new; some are from presentations I gave earlier this year. Most of them illustrate one or more things you can do with this amazing custom function (a few of the examples don’t deal with JQ directly, but play a supporting role). The aim is to convey a tiny measure of the depth and breadth of what you can accomplish with JSONQuery.

Resources:

The Sandbox file requires FM 19.6 or later (but a few of the examples use features introduced in FM 21).

A bit of info in case this is the first time you’ve heard of JSONQuery. It is a custom function which operates on JSON, created and maintained by Steve Senft-Herrera.

Typically you’re going to point it at an array of objects…

…or an array of arrays…

…and it will return child elements matching your query parameters. Continue reading “JSONQuery Odds and Ends”