You need to sign in to do that
Don't have an account?
Kourt Neyra
Scheduled class is not running daily
Hi
I have a scheduled class in my org that is used to delete records.
We have a field "Policy End Date" and daily, we need to delete the records where Policy end date is less than today.
The issue is that it is working fine the first day that we schedule it, but the following days it is not deleting the records.
someone know how to fix it?
I have a scheduled class in my org that is used to delete records.
We have a field "Policy End Date" and daily, we need to delete the records where Policy end date is less than today.
The issue is that it is working fine the first day that we schedule it, but the following days it is not deleting the records.
someone know how to fix it?
global class BorrarAsegurados implements Schedulable{ global void execute(schedulablecontext SC){ List<Enrollee__c> Asegurados = [select id from Enrollee__c where Policy_End_Date__c <= Yesterday ]; if(!Asegurados.isEmpty()) delete Asegurados; } }
it would be something like: it would be something like that?
Thank you very much fro your help
From Setup, enter Apex in the Quick Find box, then select Apex Classes.
Click Schedule Apex.
For the job name, enter something like Daily Oppty Reminder.
Click the lookup button next to Apex class and enter * for the search term to get a list of all classes that can be scheduled. In the search results, click the name of your scheduled class.
Select Weekly or Monthly for the frequency and set the frequency desired.
Select the start and end dates, and a preferred start time.
Click Save.
for testing your scheduler refere below link
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm
Thanks
Krishna
hi, this is the configuration, and there are 5300 records that should have been deleted today. for tomorrow, there are 23,000
Thanks in advance.