Delete Custom Object Salesforce

Do you want to delete custom object Salesforce?

In this Salesforce, I will explain the Salesforce delete object. I will also explain how to delete custom object in Salesforce Lightning and Salesforce Classic.

Additionally, I will explain the procedure of salesforce mass delete custom object records.

Delete Custom Object Salesforce

Before, you will learn to delete the custom object and the data record of the custom object. It is very important to know about some unique cases which you can’t delete.

In Salesforce, deleting the custom object is required when you want to clean up the system. When you delete the custom object salesforce, it goes to the special list “Deleted Objects” and it keep deleted objects for 15 days.

During this 15-day period, you can restore the deleted objects and their data, but after that, the object and its data are permanently deleted from the system.

Additionally, there are some scenarios in which you can’t delete the custom object in Salesforce:

  • You can’t delete the custom objects that are on the master side of a master-detail relationship.
  • If custom fields of the custom object are used in a roll-up summary field on another object, you can’t delete the object.
  • You can’t delete the custom object if you used it somewhere in Apex code, Visualforce page, reporting, duplicate rule, matching rule, etc.
  • If there are more than 100, 000 records in the custom object, you can’t delete it for this you need to delte the some records first.
See also  How to create list view in community Salesforce [Lightning and Classic]

With this you have learned custom object delete Salesforce.

How to Delete Custom Objects in Salesforce

In Salesforce you can delete the custom object in both Salesforce Lightning and Salesforce Classic.

Additionally, it is available in the following editions: Contact ManagerGroupProfessionalEnterprisePerformanceUnlimitedDeveloper, and Database.com.

Salesforce Delete Object in Lightning

The following are the steps to delete objects in Salesforce Lightning:

Step-1: Go to the “Setup” and click on the “Object Manager” tab, and you will get the list of all the objects, either Standard or Classic.

how to delete custom object in salesforce

Step-2: Choose the custom objects that you want to delete. After selecting the object, you can see the Details page of the custom object is open.

delete custom object salesforce

Step-3: At the top left corner of the details page, you will get the “Delete” button; click on it

salesforce delete object

Step-4: You will get the pop-up, read it carefully, and then click on the “Delete” button.

how to delete an object in salesforce

How to Delete an Object in Salesforce Classic

The following are the delete an object in Salesforce Classic:

Step-1: Log in to the salesforce account, click on the “Setup” icon, and then scroll to the bottom of the page. On the left side, there is a “Build” section; click on the “Create” dropdown from here.

how to delete a custom object in salesforce

Step 2: Select the “Objects” option and here you will get the list of the custom objects in Salesforce Classic.

how to delete object in salesforce

Step-3: Select the custom objects that you want to delete. There are two ways to delete a custom object: either click on the “Del” button next to the object or click on the “Object Name” and then click on the “Delete” button on the detail page of the specific object.

delete objects

Step-4: A pop-up will display on the screen. Read the messages carefully, then select “Yes, I want to delete the custom object” to confirm and click the “Delete” button.

how to delete object in salesforce

Salesforce Mass Delete Custom Object Records

You can delete the mass records stored in a custom object in Salesforce using different ways. The following are the ways to do so:

See also  How to Create External Credentials in Salesforce

1. Mass delete the records is using data loader in Salesforce. It is the most suitable way to do this as it saves time and gets multiple records in one go.

2. Using Truncate Function Salesforce Bulk Delete Custom Object Records

In Salesforce, you have a truncate function that deletes all the records in the custom table, i.e., from custom objects. The only drawback of this function is it is only available in Salesforce Classic.

Below are the steps to Salesforce delete all records from object.

Step-1: Login to the Classic Interface of the Salesforce account. Click on the “Setup” option.

salesforce mass delete custom object records

Step-2: Scroll down to the “Build” section -> Expand “Customize” dropdown -> Select “User Interface”.

mass delete custom object records salesforce

Step-3: Find “Enable Custom Object Truncate” in the “Setup” section and its checkbox.

Step-4: Click on the “Save” button.

salesforce delete all records from object

Step-5: Scroll down to the “Build” section -> Expand “Create” dropdown -> Select “Object” option.

how to mass delete custom object records in salesforce

Step-6: Choose the object whose records you want to delete. On the detail page, you will get the “Truncate” button; click on it.

delete all records from object salesforce

Step-7: Pop-up will open here fill the name of the object whose record you want to delete. After that, click on the “Truncate” button.

salesforce bulk delete custom object records

Conclusion:

I hope you have understood how to delete custom object salesforce. I have also explained step-by-step salesforce mass delete custom object records.

You may like to read: