1) Mass Delete Records :
Salesforce has an in-built mass-delete record tool which is available via the Quick Find box
Mass Delete Records (Setup | Data Management | Mass Delete Records).When deleting
records you have the ability to control whether the records are permanently deleted or get
sent to the Recycle Bin.
You can delete up to 250 items at one time.
Click Here To Know More About Delete Multiple Records and Reports
2) Use Data Loader or other IO Tools
There are various tools you can use to delete records including Data Loader, Jitterbit, and
Dataloader IO amongst others. These dedicated tools give you a lot of control over inserting,
updating, and deleting data in your Org.
Here is an explanation of this point from the Salesforce online documentation.
Click Here
3) Truncate Button on Custom Objects
If you are deleting the records that belong to a Custom Object then you can make use of
the Truncate button(Setup | Create | Objects | Click on the name of the Object). You will
then find a button named Truncate. You will also need to ensure that this feature is enabled
at Setup | Customize | User Interface | Enable Custom Object Truncate.
The Truncate button, once activated allows you to clear all records from a custom object. A
particularly good use case would be if you’d created a lot of test records and just wanted to
start afresh whilst preserving the object’s entire configuration.
More information on this function is available from:
Click Here
4) Apex
Using Apex you could create a Class or Trigger that deletes records programmatically.
Lets take an example:
Delete an Event if the Event’s status was updated to a specific value.
if(trigger.isUpdate) {
List<Event>lstEventsToDelete = new List<Event>();
for(Event e : trigger.new) {
Event eDel = new Event(Id=e.Id);
lstEventsToDelete.add(eDel);
}
deletelstEventsToDelete;
}
More information on this point available here:
Click Here To Know More
5) Using Developer Console
To delete some records using this method, open up the editor window and enter some code
like this – swapping MyObject for the object you want to delete from.
delete [SELECT Id FROM MyObject];
Bear in mind that you can only delete 10,000 records at a time using this method. To ensure
your code doesn’t hit a governor limit amend it to this:
delete [SELECT Id FROM MyObject LIMIT 10000];
Deleted records aren’t deleted permanently from Salesforce, but they are placed in the
Recycle Bin for 15 days from where they can be restored.
Developer console allows you to enter Anonymous Apex for deleting records
More information on this can be found here:
Click Here To Learn More
6) There’s an App for that
You can download a variety of App from AppExchange that give you additional functionality
around deleting records.
One example is called Mass Delete from Salesforce Labs which allows you to select multiple
records and delete them with one button click.
Mass Delete
Click Here