18 件の回答
Hi Allan,These steps might be help full for you. Create a schedulable apex class
Now go to Setup -> Develop -> Apex classes . Click on Schedule Apex Button and schedule your apex like thisglobal class DeleteRecords implements Schedulable{
global void execute(SchedulableContext SC) {
List<Custom_Object__c> customObj = [select Id FROM Custom_Object__c WHERE createddate = LAST_N_DAYS:30];
if(!customObj.isEmpty())
delete customObj;
}
}
Select your preffered time (Time will be based on the users time zone) and Save.Your job will run per month. You can check the status of your job by Setup -> Jobs -> Apex Jobs.Thanks.