grayscale photo of person wearing round analog watch

Schedule apex class to run every 1 hour

It’s very usual to fall in such a requirement to execute apex scheduled job every 1 hour. The dirtiest way to schedule it 24 times at a specific time. But there is another very efficient way to run it each clock hour and can be achieved by just running it once using power of cron expressions as below:

String CRON_EXP = '0 0 * * * ?';
BatchToRunHourly sch = new BatchToRunHourly ();
System.schedule('Hourly Job', CRON_EXP, sch);