Script continuation and halt: Halt Script, Exit Script, and Allow User Abort
BeginnerControl script termination precisely using Halt Script, Exit Script, and Allow User Abort Off to build safe, uninterruptible workflows.
What you'll learn
- The difference between Exit Script and Halt Script and when to use each
- How Allow User Abort [ Off ] prevents user-driven cancellation
- When it is appropriate to allow vs deny user abort
- How to build a safe cancellation checkpoint inside a long loop
- How to ensure cleanup runs even when a script is halted
Three mechanisms control how a FileMaker script stops: Exit Script (returns to the caller), Halt Script (stops everything), and Allow User Abort [ Off ] (prevents the user from pressing Escape to cancel). Choosing the wrong one at the wrong time causes data corruption, locked records, or silently aborted batch operations.
Exit Script vs Halt Script
Exit Script terminates only the current script and returns control to the parent script (if any). Halt Script terminates every script in the call stack immediately -- no parent receives control and no further steps run anywhere. Use Exit Script for normal completion and error returns; reserve Halt Script for user-initiated cancel-everything actions.
# Sub-script: Validate Record If [ IsEmpty ( Contacts::Email ) ] # Exit back to caller with an error signal Exit Script [ Text Result: "error: email required" ] End If Exit Script [ Text Result: "ok" ] # NOTE: If Halt Script were used here instead, the parent # script would never receive the result and could not clean up.
Sign in to track your progress and pick up where you left off.
Sign in to FM Dojo