profile

ScriptLogic

Create better FileMaker scripts by giving me a few minutes every day thinking about techniques and deepening your understanding.

Subscribe to receive every post as soon as it’s released…

Duplicate Records: Detect and Resolve, or Prevent

Duplicates happen. For lots of reasons. Some legitimate, some accidental. Duplicate records can cause all sorts of problems. Examples of these are: Incorrect reports, totals, counts, and dashboards Repeated invoicing and double payments Multiple contacts for the same thing (email, SMS, etc) with the same person Conflicting data across duplicates (email, phone, notes) Poor customer experience leading to reduced trust in the database and the business How can this happen? The most obvious cause...
READ POST

The shortcut to a called script

Anyone who has built up experience in a particular skill knows a whole range of techniques and shortcuts. I have an interest (obsession?) in carpentry and woodwork for DIY projects. As a result my YouTube feed is full of these videos. I love watching short videos with tips and tricks for making my woodworking easier. Although it is a much more niche area and there are not many videos on the topic, there are also great tips and tricks for working with the FileMaker Script Workspace. Open a...
READ POST

When stop is not really stop

From our discussions in the past few days, it is reasonable that a user may want to stop a process that is taking a long time or seems to be stuck in a loop. There will be consequences As we have discussed, just stopping a process dead may have small or major consequences. The small consequence may be that the user is left in an unfamiliar state. They may be in a window they did not explicitly open, on a layout they have never seen before, with a found set of records they did not create. In...
READ POST

How do I stop this thing?

If the user wants to stop a process that is running, why not just let them? Let’s revisit the rollercoaster story. Under normal circumstances, once the carriages have left the station, they twist and turn, go upside down, chug up hills, race down hills and generally impart thrills aplenty. As a rider, you have no control over this. Once you are strapped in, you are in for the entire ride—all the way back to the station. Now imagine that each rider has their own control to stop and get off at...
READ POST

How do I stop this thing?

Following on from yesterday's conversation let's consider that you have pressed a button to run a process. You find that the process is now taking a long time and you want to cancel. How do you stop it running? There are standard FileMaker keyboard shortcuts to cancel a running script. On both Mac and Windows you can press the Esc key. On Mac, you can also use the keyboard combination Command+. (command-period). These keyboard shortcuts only work if the user abort state is ON. If user abort...
READ POST

Stop! I want to get off.

I remember many years ago being at a theme park and all strapped in to start a rollercoaster ride. No sooner had we left the station than someone started screaming: he had decided that he didn't want to go on the ride. The ride stopped halfway up the first rise. The systems were checked, the screaming continued, and everything was deemed safe to proceed. So off we went. When we returned to the station, one man departed the station very quickly. Many of the scripts you write simply start, run,...
READ POST

One script to manage a process

One of the most common script patterns that I use is when I have a process with a number of actions. In many cases this is a script to manage a particular entity. So actions can be any of Open, Add, Edit, Save, Cancel and Exit. Each action will perform a discrete series of script steps. For example, the Open action may open the current record in a card window; the Add action may open the same card window and create a new record. This pattern means that all buttons associated with the process...
READ POST

Loop, but just once.

A loop is a standard structure in programming. It is designed to process a block of code a number of times until a condition says to stop. A loop has three essential parts: a starting point, the code to repeat and an exit condition. A loop may work through a set of records, a set of fields in a record, or a block of text such as JSON. It may also be used to retry an operation, build a list, or check a condition until it becomes true. try/catch Another programming structure available in many...
READ POST

Are your FileMaker scripts idempotent?

Idempotency? Eedemwhat? Huh? Never heard of it? It is pronounced either ee-dem-po-ten-see or id-em-po-ten-see. Any process is idempotent if applying it multiple times has the same effect as applying it once. In real life, an example is pressing the button to cross at a pedestrian crossing. When someone presses the button, it registers a crossing request. The pedestrian walk indicator is added into the light changing schedule. If someone across the road also presses the button, there is no...
READ POST