Truncate
In Salesforce, the action of permanently removing all records from a custom object while preserving the object's metadata, fields, and configuration, used to clear data without deleting the object definition itself.
Definition
In Salesforce, the action of permanently removing all records from a custom object while preserving the object's metadata, fields, and configuration, used to clear data without deleting the object definition itself.
In plain English
“Truncate in Salesforce permanently removes all records from a custom object while preserving the object's metadata, fields, and configuration. It's like emptying a table without deleting the table itself. Use with extreme caution since it's permanent.”
Worked example
Vexford Software's data steward needs to clear all 240,000 records from a custom Test_Data__c object that was used for performance testing - but keep the object's metadata, fields, and configuration intact for future tests. She uses Truncate (in Setup): the operation permanently deletes every record in the object (no Recycle Bin recovery) while leaving the schema untouched. After Truncate, the object is empty but ready to receive new test data. Truncate is destructive and irreversible - the team uses it cautiously, never on production data, and only when bulk-delete via Bulk API would be too slow.
Why Truncate matters
In Salesforce, Truncate is the action of permanently removing all records from a custom object while preserving the object's metadata, fields, and configuration, used to clean out data without affecting the object's structure. It's much faster than deleting records one by one for large datasets.
Truncation is a destructive operation that cannot be undone. Records removed by truncation don't go to the Recycle Bin. Mature orgs use truncation carefully, typically only in development or testing contexts, with explicit documentation and approval for any production truncation.
How organizations use Truncate
Uses truncation in development sandboxes to reset test data quickly.
Requires explicit approval for any production truncation request.
Treats truncation as a development/testing tool, not a routine production operation.
Trust & references
Straight from the source - Salesforce's reference material on Truncate.
- Truncate Custom ObjectsSalesforce Help
Test your knowledge
Q1. What does Truncate do?
Q2. Can truncation be undone?
Q3. When should you use it?
Discussion
Loading discussion…