Salesforce Certificate

Friday, 12 July 2013

Schedule Apex to run Every 24 HOUR


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);

4 comments:

  1. I really enjoyed while reading your article, the information you have delivered in this post was damn good. Keep sharing your post with efficient news.
    cloud computing training centers in chennai|cloud computing training institutes in chennai

    ReplyDelete
  2. Why not use a ready-made solution?
    Our company developed package, that will help to configure run time every time you need!
    Available on AppExchange for free https://appexchange.salesforce.com/listingDetail?listingId=a0N3A00000DqCmYUAV.

    ReplyDelete
  3. Candid institute Spring and Hibernate course provides a comprehensive introduction to Spring and Hibernate open source frameworks as well as Web Services and AJAX. Suitable for both Spring3/Hibernate3 and Spring4/Hibernate4, the course includes coverage of the core Spring and Hibernate capabilities, as well as the integration capabilities provided by Spring.
    Java training institute in chennai

    ReplyDelete
  4. The Best Has Given In this Blog About Salesforce development.
    Very Great Blog With Unique Content..
    Thanks@Salesforce

    ReplyDelete