function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MSchumacherMSchumacher 

Mass delete custom objects

I am testing a number of insert routines for a custom object using the APIs.  I noticed in the salesforce.com setup area, there does not appear to be a way to mass delete rows in a custom object.

Is there a recommended way to mass delete rows from a custom object?  I have been unable to find the right message in the various posts.

I want to delete the rows I added so I can retest as needed.  Do I need to create a separate program to select the rows by create date and delete each one.

Thanks

Mike Schumacher

Best Answer chosen by Admin (Salesforce Developers) 
SoloSolo

Hello - I had the same requirements.

Here is a quick and efficient solution.

1) Install Mass Delete tool from the App Exchange on the sand box - you will get a Mass delete buttons (with Execute JavaScript code) for standard objects

2) Create similar Mass Delete button for your custom object. Edit second line of the code with API name of your custom object. Foe example:

var records = {!GETRECORDIDS( $ObjectType.Custom__Obj__c)};

3) Add the button on the Object's List View

That's it.

Regards.


All Answers

benjasikbenjasik
I'd suggest you use the open source excel connector for this or the Sforce Data Loader when it's available in 3 weeks.

Or you could write a bit of sforce code to select the records you want to delete, then use the delete call to delete them
MSchumacherMSchumacher

Thanks Benji,

I wrote some code to simply select the records to delete and use the delete function.

Mike Schumacher

SoloSolo

Hello - I had the same requirements.

Here is a quick and efficient solution.

1) Install Mass Delete tool from the App Exchange on the sand box - you will get a Mass delete buttons (with Execute JavaScript code) for standard objects

2) Create similar Mass Delete button for your custom object. Edit second line of the code with API name of your custom object. Foe example:

var records = {!GETRECORDIDS( $ObjectType.Custom__Obj__c)};

3) Add the button on the Object's List View

That's it.

Regards.


This was selected as the best answer