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 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.

Delete all Records from Custom Object

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

Enable Custom Object Truncate
Points to Note
  • ‘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 custom object, then please review the article ‘Truncating Custom Objects’ as mentioned below
  • For safety reasons, I will recommend keep the checkbox unchecked 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

3 thoughts on “Deleting all Records from a Custom Object”

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top
Introducing All Access Pass