Monday 3 September 2012

Scheduler class ?


What is Scheduler class in Apex?

Ans:- The Apex class which is programed to run at pre defined interval.
Class must implement schedulable interface and it contains method named execute().
Two ways to Invoke scheduler :-
a)    Using UI.
b)    Using System.Schedule.

The class which implements interface schedulable
get the button texted with “Schedule”,
when user clicks on that button,
new interface opens to schedule the classes which implements that interface.
To see what happened to scheduled job,
go to “Monitoring | Scheduled jobs “.
Example:-
scheduledMerge m = new scheduledMerge();
String sch = '20 30 8 10 2 ?';

system.schedule('Merge Job', sch, m);

No comments:

Post a Comment