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
santhosh konathala 8santhosh konathala 8 

How to run schedule apex from developer console

Vijay NagarathinamVijay Nagarathinam
Developer console -->Debug -->Open execute anonymous window 

In that window create a object of your Schdule Apex class then call excute() method passing as null like below

YourScheduleApexClass s=new YourScheduleApexClass();
s.excute() ;

Vijay NagarathinamVijay Nagarathinam
Use the below code in your developer console, anonymous window,
SchedularForBatchApexSFBA = new SchedularForBatchApex ();String sch = ‘0 0 24 31 12 ?';system.schedule(‘Execute Schedular’, sch, BWE);

Amit Chaudhary 8Amit Chaudhary 8
Please check below post for Batch job and Scheduler class. I hope that will help you

How to Schedule scheduler class
There are two option we have schedule the scheduler classes.
1) By System Scheduler.
2) By Developer console

System Scheduler.

Step 1) Click on Setup->Apex class. Then search Schedule Apex button.
Step 2) Select the scheduler class and set Time

By Developer console 

Execute below code from developer console :-

AccountUpdateBatchJobscheduled m = new AccountUpdateBatchJobscheduled();
String sch = '20 30 8 10 2 ?';
String jobID = system.schedule('Merge Job', sch, m);

Let us know if this will help you

AMit Chaudhary

Hi Amit/Vijay, 

What does sch mean? 

Can you please explain why you have those respective values? 

Wade Lovell 84Wade Lovell 84
// Seconds Minutes Hours Day_of_month Month Day_of_week optional_year

'sch' is just the variable name being assigned to schedule in the code above

You can learn more at:

Suraj Tripathi 47Suraj Tripathi 47

Hi Santhosh,

You can run using an anonymous window. You can take reference from the below syntax.
ClassName name1= new ClassName (); 
String cronExp= '0 0 * * * ?';
System.schedule('Scheduled', cronExp, name1);

If you find your Solution then mark this as the best answer. 

Thank you!

Suraj Tripathi