Deleting all Records from a Custom Object

What is the simplest and fastest way to delete all records from a custom object? Do it from the Developer Console by writing a few lines of Apex Code. Right? Well, not really. To delete all records from a custom object, just navigate to the custom object definition, click on ‘Truncate’, and that’s it.

For the ‘Truncate’ option to show on a custom object, do not forget to check ‘Enable Custom Object Truncate’ from Setup > Customize > User Interface as shown below.

Points to Note

  • The ‘Truncate’ button is only available in Classic and won’t be visible in Lightning Experience (LEX).

  • If you don’t see the ‘Truncate’ button on the custom object, then please review the article ‘Truncating Custom Objects’ as mentioned below.

  • For safety reasons, I recommend keeping the checkbox unchecked in the Production environment.

References & Useful URLs

  1. Truncate Custom Objects - Help Article (5 mins) - https://help.salesforce.com/articleView?id=dev_object_trunc.htm&type=5

  2. Truncating Custom Objects - Help Article (5 mins) - https://help.salesforce.com/articleView?id=dev_object_trunc_overview.htm&type=5