+ Start a Discussion
Karthick RajaKarthick Raja 

Process of Scheduler classes

Hi folks,
           Can anyone tell me the purpose of scheduler classes and how to use scheduler class?
I need a simple code for scheduling so that I can know process of scheduler class..




Thanks in advance
Karthick
Best Answer chosen by Karthick Raja
PratikPratik (Salesforce Developers) 
Hi Karthick,

Here is the simple example:
https://help.salesforce.com/HTViewSolution?id=000107356&language=en_US

Thanks,
Pratik

P.S. If this answers you question, please mark it as "Best Answer" so it will help other community members too.

All Answers

PratikPratik (Salesforce Developers) 
Hi Karthick,

we use scheduler to invoke Apex classes to run at specific times.

You can refer to this link for details and sample code: 
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm

Thanks,
Pratik

PratikPratik (Salesforce Developers) 
Hi Karthick,

Here is the simple example:
https://help.salesforce.com/HTViewSolution?id=000107356&language=en_US

Thanks,
Pratik

P.S. If this answers you question, please mark it as "Best Answer" so it will help other community members too.
This was selected as the best answer
Karthick RajaKarthick Raja
@Pratik ,
Thanks for quick response..
I dono how to execute the scheduler...


Please help!
Jagannatha Reddy BandaruJagannatha Reddy Bandaru

Hi Karthick,

if you want to schedule your batch class

just follow the below steps,

write this code in apex class---->

public class classname implements schedulable
{
public void execute(ScheduleContext SC)
{
//create instance for batch class name
batchclassname bt=new batchclasname();
bt.executeUpdate();

}
}

at apex itself we can do schedule but it is only hour basis.

if you want like sec or min basis you can write cron trigger in developer console


goto Developer console

first create instance for scheduleclass
like

classname cls=new classname();
String cron-trig='0 0 11 10 10 ? 2014';
System.schedule('schedulejobname',cron-trig,cls);

click execute go and check in schedule jobs with schedulejobname.

Thanks,
Jagan
jagan.srit@gmail.com