Reference > Script steps reference > Records script steps > Truncate Table
Truncate Table
Deletes all records in the specified table regardless of the current found set.
See also 
Truncate Table [With dialog: On/Off; <Current Table>/Table: “<table name>”]
With dialog specifies whether to display a dialog box when the script step is performed, asking the user to confirm the deletion of records.
Current Table is the active table when this script step is performed.
Specify Table lets you choose a table in the current file.
Where the script step runs 
FileMaker Pro 
FileMaker Server 
FileMaker Go 
Custom Web Publishing 
FileMaker WebDirect 
Runtime solution 
Originated in 
FileMaker Pro 15.0
Important  You cannot undo deleting all records.
Truncate Table attempts to lock all records in the table before deleting them. If it can't lock all records (for example, if a record is being edited by another user), Truncate Table stops and returns an error code (which can be captured with the Get(LastError) function).
This script step may be faster than the Delete All Records script step for deleting a large number of records.
Truncate Table does not delete related records even if the relationship is set up to do so (see Creating and changing relationships). To delete related records as well, use Delete All Records instead.
If you choose Current Table and the active table when this script step is performed is from an ODBC data source, Truncate Table is skipped and returns an error code. If the active table is from an external FileMaker data source, Truncate Table performs normally.
Server-side scripts and Custom Web Publishing run this script step as if the With dialog option is Off.
Example 1 
After asking the user, deletes all records in the table named Invoices.
Truncate Table [With dialog: On; Table: “Invoices”]
Related topics 
Script steps reference (alphabetical list)
Script steps reference (category list)