In Salesforce, we can delete mass records using the Mass Delete Wizard which can be accessed from Data Management > Mass Delete Records but there is a limitation of deleting 250 records at once using the Mass Delete Wizard and it only allows to delete Accounts, Contacts, Leads, Activities, Cases, Solutions, and Products records.
If you want to delete a high volume of records like more than 250 records then Data Loader is going to help in performing the delete operations of object records and unlike Mass delete wizard, Data Loader can access and delete records of custom objects also.
In this Salesforce tutorial, we are going to learn about the method to Delete the records using the Data loader in Salesforce.
Deleting records with Salesforce Data Loader
In Salesforce, Data Loader is a powerful tool used for importing, exporting, and deleting records. It is preferred when it is required to perform mass deletions of standard and custom object records in Salesforce. While deleting the data with data loader it is always suggested to keep the backup of data because the deletion cannot be undone.
Considerations
Below are some considerations to keep in mind when deleting records using Data Loader.
- Before initiating any delete operation, always keep a backup of the data.
- Check the dependencies on the records that you are going to delete. If the record is referred to in workflow rules, processes, validation rules, or in relationship with another object then it will not get deleted and give error.
- Make sure that you have the necessary permissions to delete records. Without the appropriate permissions, the delete operation may fail.
Delete the Records Using Data Loader in Salesforce
In this scenario, I will explain the deletion of the Records using the Data Loader for the Leads record.
To delete the record, we need to prepare a CSV file in our system and the easiest way to get the subset of records you’d like to delete is by exporting details of that object.
In this example, I have exported a few Lead records. The only column you need in the report is the Lead ID field (Record ID).
1. To export the records go to Data Loader and select Export -> select browse location for extracted records -> click Next.
2. Select the ID field, and the name field then click on the Finish button.

3. Now open that exported data in a CSV file and copy the header column and ID of the records that you have to delete.

4. Now open a new CSV file and paste the header column ID and under that paste the ID of the records that you have to delete.
After this save this CSV file from where you can access it with the data loader.

5. Now open the data loader and log in with your credentials. Then on the setup of the data loader click on the Delete button.
