You need to sign in to do that
Don't have an account?
Caroline Poole 9
Schedulable Apex Class - Text Class
I created a schedulable apex class that deletes Marketo Activities in salesforce after a week so our activity volume doesn't get too high.
Is anyone able to help me write a test class for this? Or give me guidance? THANK YOU!!
----
global class DeleteMarketoActivities implements Schedulable{
global void execute(SchedulableContext SC) {
List<Task> Obj = [select Id FROM Task WHERE CreatedById = '0050a00000GeV2hAAF' AND CreatedDate != LAST_N_DAYS:7];
delete Obj;
}
}
Is anyone able to help me write a test class for this? Or give me guidance? THANK YOU!!
----
global class DeleteMarketoActivities implements Schedulable{
global void execute(SchedulableContext SC) {
List<Task> Obj = [select Id FROM Task WHERE CreatedById = '0050a00000GeV2hAAF' AND CreatedDate != LAST_N_DAYS:7];
delete Obj;
}
}
Posting a simple test class here. Let me know if it gives you any coverage
NOTE: The code provided is an example. You'll need to review and make modifications for your organization.
Let me know if this helps, if it does, please mark this answer as best so that others facing the same issue will find this information useful. Thank you