Wednesday, January 30, 2013

Mass Delete in Salesforce

Mass Deleting of Custom Object Data in Force.com (Salesforce) made easy.

Executing a small piece of Apex Code using Developer Console is the easiest way to get rid of Mass Data from your Custom Objects.

Execute the following APEX Code using Developer Console.

App Setup >> Tools >> Developer Console is the menu to access Dev Console, if you want to.





And, here is the APEX code to execute.


String[] ss = new String[]{'ABC-0000000005', 'ABC-0000000007'};

List existing = [SELECT Id From My_Custom_Object__c WHERE Name IN :ss];

delete existing;

As you can see, WHERE clause of the SOQL can be customized at your will.

Good Luck.

No comments: