Aim- I want to delete any record within custom object training__c where the created date is greater than 6 months from today's date.
I would like to run this job daily.
I apologise if the following below has errors I just wrote this on my iPhone, Does the following logic below make sense ?
Looking forward to your help
List listsObject = [Select Id from training where Createddate <= ( Current Date – 6 months) Limit 9000];Delete
You could create a class that implements the schedulable interface and do something like this:
Then, you can schedule the class to run daily from an anonymous block or by going to Setup > Develop > Apex Classes > Schedule Apex.