Developer Console – Delete Multiple Records

Is there a DML or other way to delete all records from the developer console? For example, we have 100K Leads in our testing environment and we would like to delete all of them in one operation.

Is that possible?

By the way, I saw there is a mass delete option, although it only lets you delete a few hundreds records at a time…. (using Setup-> Administration Setup->Data Management -> Mass Delete Records.)


You can delete records from the developer console with the line

delete [SELECT Id FROM MyObject];

However, this isn’t going to delete 100k records successfully due to governor limits. You’re going to need to use dataloader to export the 100k records, then use the export to delete the records.

Edit: Better than that, you can use LIMIT to select a subset, and then rerun the command after each execution

delete [SELECT Id FROM MyObject LIMIT 10000];

Source : Link , Question Author : Uri Lukach , Answer Author : Community

Leave a Comment