FileMaker script error handling with Set Error Capture

Beginner

Learn the mandatory error handling pattern for FileMaker scripts: suppress dialogs, check Get(LastError) after every risky step, and exit cleanly with diagnostic information.

What you'll learn

  • What Set Error Capture does and why it must be the first step in every script
  • How to check Get(LastError) and exit with diagnostic information
  • Which script steps can fail and need error checks

Without error handling, FileMaker shows a dialog to the user whenever a script step fails — and then the script continues as if nothing happened. Proper error handling suppresses those dialogs and gives you full control over what happens when something goes wrong.

1/4
1

Start every script with Set Error Capture

Set Error Capture [ On ] suppresses FileMaker's built-in error dialogs. From this point on, your script is responsible for checking whether steps succeeded.

FileMaker Script
Set Error Capture [ On ]
Allow User Abort [ Off ]

# ——————————————————————————————
# Purpose:          <what this script does>
# Parameters (In):  <inputs>
# Parameters (Out): True on success, error code on failure
# ——————————————————————————————

Sign in to track your progress and pick up where you left off.

Sign in to FM Dojo