function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Alta MontclairAlta Montclair 

Scheduled everyday APEX job does not run on the next day

Hello,

I have a scheduled class SendBirthdayCards_BatchJob that is setup within the Setup->Monitoring->Scheduled Jobs. It is set to run everyday at 9PM. It shows started and next scheduled run. When I just set it up, it ran emmideatelly. However it does not run on the next day, started and next scheduled dates are changed, but job was not run. I cannot see any records at all in APEX jobs list.

Can you help me to resolve the issue?
Thanks in advance.
Jagan ReddyJagan Reddy
SendBirthdayCards_BatchJob sch=new SendBirthdayCards_BatchJob();------->create instance for schedule class like this
String cron='0 0 21 * 1 ? 2015 ';
System.schedule('schedulejobname',sch,cron);

try this to schedule your job, place this code in developer console ctrl+E click execute.

it is running immediately means check your time zones in org.kindly let me know any doubts


Thanks,
jagan
Alta MontclairAlta Montclair
Hi Jagan,
I executed the code . It ran immediately. My org time zone is correct. Schould I check wthether it runs tomorrow?

Thanks for your help.

Irina


 
Alta MontclairAlta Montclair
I changed 
System.schedule('schedulejobname',sch,cron); in your code

to

System.schedule('schedulejobname',cron,sch);
 
Jagan ReddyJagan Reddy
i think both are same what ever u changed


System.schedule('schedulejobname',sch,cron); in your code

to

System.schedule('schedulejobname',cron,sch);
 
Jagan ReddyJagan Reddy
otherwise test now itself we will see it is working or not?

Thanks,
jagansfdc@outlook.com
Alta MontclairAlta Montclair
I executed as you said and it ran immediately. But it was working the first run before when I scheduled via GUI. However my problem is it did not run on the next day.

I will check tomorrow if it runs again after I set it up via Developer Console
Jagan ReddyJagan Reddy
Ok that's cool