I apreciate all of the answers. I also realized that if you use "implements Schedulable" in the class and then have a "execute(SchedulableContext SC)" section you can go to apex classes and then click on the schedule button. thanks for all the help.
String seconds = '0'; //Execute at Zero Seconds String minutes = '0'; //Execute at 0th minute of hour String hours = '17'; // Execute at 5pm String dayOfMonth = '*'; // Execute Every Day of the Month String month = '*'; // Every MOnth String dayOfWeek = '?'; //Execute on all 7 days of the Week String year = '*'; //Execute every year
I apreciate all of the answers. I also realized that if you use "implements Schedulable" in the class and then have a "execute(SchedulableContext SC)" section you can go to apex classes and then click on the schedule button. thanks for all the help.
I apreciate all of the answers. I also realized that if you use "implements Schedulable" in the class and then have a "execute(SchedulableContext SC)" section you can go to apex classes and then click on the schedule button. thanks for all the help.
All Answers
JobClass m = new JobClass();
String seconds = '0'; //Execute at Zero Seconds
String minutes = '0'; //Execute at 0th minute of hour
String hours = '17'; // Execute at 5pm
String dayOfMonth = '*'; // Execute Every Day of the Month
String month = '*'; // Every MOnth
String dayOfWeek = '?'; //Execute on all 7 days of the Week
String year = '*'; //Execute every year
//Seconds Minutes Hours Day_of_month Month Day_of_week optional_year
String sch = seconds + ' ' + minutes + ' ' + hours + ' ' + dayOfMonth + ' ' + month + ' ' + dayOfWeek + ' ' + year;
system.schedule('Job at 5pm every day ', sch, m);
String sch = '0 0 17 * * ?';
system.schedule('Job at 5pm every day ', sch, m);
hi
you need to write three lines of code in developer console
Classname cl = new classname();
String sc ='0 0 17 * * ?';
System.schedule("some name" , sch, sc);
it will runs everyday at 5pm.
check this link also
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm
I apreciate all of the answers. I also realized that if you use "implements Schedulable" in the class and then have a "execute(SchedulableContext SC)" section you can go to apex classes and then click on the schedule button. thanks for all the help.