Schedule Class To – Run at Every 24 HOUR Everyday..
Following is the snippet of anonymous code which will help you to schedule your apex Job to run Every HOUR.
Write below code in “Developer Console” to schedule class for every One Hour Everyday.
Apex Code:
ScheduleclassEveryhour objschclass = new ScheduleclassEveryhour ();
string strSeconds = ‘0’;
string strMinutes = ‘0’;
string strHours = ‘0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23’;
string strDay_of_month = ‘*’;
string strMonth = ‘*’;
string strDay_of_week = ‘?’;
String sch = strSeconds + ‘ ‘ + strMinutes + ‘ ‘ + strHours + ‘ ‘ + strDay_of_month + ‘ ‘ + strMonth + ‘ ‘ + strDay_of_week;
system.schedule(‘ScheduleclassEveryhour’, sch, objschclass);