You need to sign in to do that
Don't have an account?
anil Kumar
Batch job schedule
Hi All,
I have requirement where i need schedule batch job 4 times in day. this are the timinings 1AM EST, 10 AM EST, 3PM EST, 8PM EST. I have schedule this using cron expression in dev console. i have prepared script below, please advise is this correct.
className c = new className();
String sch = '0 0 1,10,15,20 * * *';
system.schedule('Four times in day ', sch, c);
Thanks,
Anil Kumar
I have requirement where i need schedule batch job 4 times in day. this are the timinings 1AM EST, 10 AM EST, 3PM EST, 8PM EST. I have schedule this using cron expression in dev console. i have prepared script below, please advise is this correct.
className c = new className();
String sch = '0 0 1,10,15,20 * * *';
system.schedule('Four times in day ', sch, c);
Thanks,
Anil Kumar
Type following thing and click execute.
After executing this code block.
Go to Setting/Setup -> Scheduled Jobs
You can see these 4 jobs scheduled with necessary details.
(This will run everyday from the day it's scheduled)
Please mark this as Best Answer, if this solves your problem.
All Answers
Type following thing and click execute.
After executing this code block.
Go to Setting/Setup -> Scheduled Jobs
You can see these 4 jobs scheduled with necessary details.
(This will run everyday from the day it's scheduled)
Please mark this as Best Answer, if this solves your problem.
Here is a solution to your Problem.
className c = new className();
String sch = '0 0 1,10,15,20 * * ?';
system.schedule('Four times in day ', sch, c);
I hope it will help you.
Please select this as Best Answer so that other's also get help from this.
Thank You
Akshay
Thank you for the replay..
Could you please explain me what mean by 1/1 in the below expression. Also can we keep ? at 6 position insted of 5th position.
Thanks,
Anil Kumar
That ensures that batch executes every day
1/1 -> first 1 means starting date, second 1 means increament.
Strating from 1st of every month, keep increamenting by 1.
Each value is meant for specific purpose
First parameter is for second, second for minute, third for hours, fourth for day and so on...
You can find more info on the web about Salesforce cron expression.
Hope this helps.
Please mark relevant answer as correct, if your problem has been resolved.