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
AbanteAbante 

Massive delete

Hello everyone,

 

 

Is there any simple way to schedule a massive delete of a custom object?

 

I want to insert new records everyday, but I want to save time and schedule a massive delete during the night

 

Thanks in advance

 

 

Cory CowgillCory Cowgill

Take a look at Batch Apex and Scheduleable Apex. You can create Apex Jobs that do mass deletions according to your schedule.

 

http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#CSHID=apex_batch_interface.htm|StartTopic=Content%2Fapex_batch_interface.htm|SkinName=webhelp

ngabraningabrani

Hi,

 

You could develop an Apex batch script to be scheduled everynight. The batch script will first select records that meet your criteria, and then delete them.

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.htm

 

Naveen