You need to sign in to do that
Don't have an account?

Error scheduling chron job
Via anonymous apex, I'm trying to schedule a job to run at 11pm on the first of every month using the following:
RenewalBatch job = new RenewalBatch(); // Scheduling string parameters // Seconds Minutes Hours Day_of_month Month Day_of_week optional_year String 1stOfMonthAt11pm = '0 0 23 1 * *'; System.schedule('Renewal Batch Job Monthly at 11pm', 1stOfMonthAt11pm, job);
However, I receive the following error:
Execute Anonymous Error
Line: 5, Column: 8
Unexpected token '1'.
and am unable to resolve this. What could be the issue here?
Hi DML2020,
enewalBatch job = new RenewalBatch();
// Scheduling string parameters
// Seconds Minutes Hours Day_of_month Month Day_of_week optional_year
String 1stOfMonthAt11pm = '0 0 23 1 * ? * '; // please use this regex
System.schedule('Renewal Batch Job Monthly at 11pm', 1stOfMonthAt11pm, job);
I hope you find the above solution helpful.
If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Suraj