Delete All Records safely with confirmation and privilege guards
BeginnerUse confirmation dialogs, RunWithFullAccess, and pre-delete checks to prevent accidental data loss when scripting bulk deletes.
What you'll learn
- How to require explicit user confirmation before any bulk delete
- How to use RunWithFullAccess to perform the delete under elevated privileges
- How to check found-set size before deleting to prevent accidental full-table wipes
- How to log the delete operation for audit purposes
The Delete All Records script step is one of the most dangerous in FileMaker -- it permanently removes every record in the current found set with no undo. A production-safe implementation requires a confirmation dialog, a found-set size check, and proper privilege handling so that only authorized users can proceed.
1/3
1
Confirm the operation with a count-aware dialog
Show the user exactly how many records will be deleted. If they have not deliberately filtered to the intended set, they should cancel. Use Show Custom Dialog with a custom message; check the dialog result before proceeding.
FileMaker Script
Set Variable [ $count ; Value: Get ( FoundCount ) ] # Safety rail: refuse to delete the entire table without a filtered found set If [ $count = Get ( TotalRecordCount ) ] Show Custom Dialog [ "You cannot delete all records -- please filter to the specific records you want to remove first." ] Exit Script [ Text Result: "cancelled" ] End If Show Custom Dialog [ Title: "Confirm Delete" ; Message: "You are about to permanently delete " & $count & " record(s). This cannot be undone. Continue?" ; Button 1: "Delete" ; Button 2: "Cancel" ] If [ Get ( LastMessageChoice ) != 1 ] Exit Script [ Text Result: "cancelled" ] End If
Perform Find patterns: find, constrain, extend, and omitGo To Object: naming conventions and targeting popovers and slides
Sign in to track your progress and pick up where you left off.
Sign in to FM Dojo