Is there any tool that allows you to mass-delete custom object records using only the External Id on that object record rather than the Salesforce record Id?
[SalesForce] Mass Delete Custom Object Records Using External Id
Related Solutions
You must wait between several days up to a week in order to delete the parent record. Even if you empty the recycle bin, the records are not "permanently" deleted until some reaper job on the Salesforce side runs to truly delete them.
If you're in a rush, you can open a case with Salesforce asking to "run a physical delete" on your org. They will require that you agree to empty your recycle bin first.
The deleted records don't count toward your data storage limit.
We have worked around this problem by setting a 'status' field on the parent object to indicate that we want it deleted. After we delete all of the child records, we set the status to 'Deleting'. Then, create a Scheduled Apex job that runs around nightly trying to delete the parent records that are in that status. You must rescue the possible exception and carry on. Sooner or later, the records can be deleted.
Last caveat: sometimes the org gets corrupted and even the 1 week rule doesn't hold true. In that case, you will need to open a case and have them escalate it to R&D for physical deletion. This is rare, but it does happen.
The bit of Scheduled Apex we use looks something like:
List<SupremeQueryResult__c> deletedSnapshots = [SELECT Id FROM SupremeQueryResult__c
WHERE Status__c IN('Deleted','Deleting')];
for(SupremeQueryResult__c result : deletedSnapshots){
try{
delete result;
}
catch(System.DmlException dmle){
if(dmle.getDmlType(0) != StatusCode.DELETE_OPERATION_TOO_LARGE){
throw dmle; //reraise
}
}
}
A previous organisation I worked had had a couple of child objects with over 250 million rows of data in.
When the time came to delete some of it we populated a custom indexed field on the relevent parent object records (eg all with a created date in 2013) with a sequential range of values, and then used Informatica to run a query to extract record ids from the child object for a range of values in the parent object custom field that equated to 100,000 child records and then hard delete them.
We then had a batch script to increase the range of values for the parent object and reran the extract/delete process. Informatica allowed us to schedule the job to run every 10 minutes, using this method we were able to delete 70 million records over a weekend.
Best Answer
I don't think this is possible without a level of complication, no.
Depending on where your list of external ids exist, you could do this using the developer console, and Execute Anonymous Apex.. Load a list of the records you want based on the external id criteria(/data) and then delete said list.
Alternatively, a method we have used before with the Salesforce Dataloader, is to create a new checkbox field on the custom object (defaulted to false). Then, take the CSV of External IDs and use it to perform an update on the records, setting this flag to "true" (so only the listed external IDs are affected). You can then use this flag to determine which records to delete from Salesforce either via the interface, developer console, or using the dataloader again (which is more complicated) to pull out the SF IDs of the "infected" records and then push them back up to a delete command!
Data management is not part of my day to day job, so solutions like the above seem more like the norm to me.