Truncating a custom object allows Salesforce to delete all records from particular objects and save the empty object and its metadata. This is a fast way to delete all records from custom objects compared to Import Wizard and Data Import Wizard. This action will remove records from custom objects and you cannot recover them from the recycle bin.
Enable Truncate for custom objects: Before using this feature for your organization, you must enable it. To do this, follow these instructions:
- Go to Setup | Build | Customize | User Interface.
- 2. On the user interface page, navigate to the Setup section.
- Select the Enable Custom Object Truncate checkbox, as shown in the following screenshot:
- Click on Save.
Performing Truncate for custom objects: You can use this feature when you have created a custom object and filled it with test records. To delete those test records with a single action, you can use this feature. To perform this action, follow these instructions:
- Go to Setup | Build | Create | Objects.
- Identify the object on which you want to perform this action and click on an object name to go to its detail page. In this example, Waypoint Object is selected.
- Click on the Truncate button, as shown in the following screenshot:
- It will pop up a window. Read the warning message carefully and type the
object name as shown in the following screenshot:
- Click on the Truncate button to complete the process.
- Truncating a custom object permanently removes all of its records.
- You can’t recover the records from the Recycle Bin.
- A copy of the truncated object appears in the Deleted Objects list for 15 days, during this period the object and its records continue to count toward your organization’s limits, and then the copied object and its records are permanently deleted.
- You cannot truncate object with one or more child objects as containing data, this include Master-Detail and Lookup relationship.
- If you have any auto-number field, the number will be continue from truncated object.
- You cannot truncate custom objects, that are referenced by another object through a lookup field or that are on the master side of a master-detail relationship.
- You cannot truncate custom objects, that are referenced in a reporting snapshot, or have a custom index or an external ID, or have activated skinny tables.