You need to sign in to do that
Don't have an account?
Jaanu
Test Class for apex batchable class ?
I have the following class ...When I am trying to schedule this apex class ... not able to find it ... thinking that it's bec there is zero test coverage .. am i correct on that ? If so, how to write test class to get test coverage 100%..
When I tried to schedule the same class in DEV, I was able to schedule it ... I did not have any test class also ... thanks.
global 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; } }
When I tried to schedule the same class in DEV, I was able to schedule it ... I did not have any test class also ... thanks.
global 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; } }
Try this :
Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.
Thanks
Varaprasad
Salesforce Freelance Consultant/Developer/Administrator
@For Salesforce Project Support: varaprasad4sfdc@gmail.com
Salesforce latest interview questions :
https://www.youtube.com/channel/UCOcam_Hb4KjeBdYJlJWV_ZA?sub_confirmation=1