Steps to Schedule Apex
- Define Scheduled Apex Class
- Run the system.schedule Anonymous Code to Schedule the Apex Class (Read More on System.Schedule @ http://tinyurl.com/yg2d7qj)
- Setup | Monitoring | Scheduled Jobs to list the above Scheduled Job
global class scheduledMerge implements Schedulable{
global void execute(SchedulableContext SC) {
mergeNumbers M = new mergeNumbers();
}}
Steps to Update Scheduled Apex Code
- Delete the Scheduled Job from Setup | Monitoring | Scheduled Jobs
- Edit/Update the underlying Apex Class. (Save will result in “the class has pending jobs” error, if you haven’t deleted the Scheduled Job i.e., STEP1 is prerequisite for this STEP2)
- Run the Anonymous Code to Schedule the Apex Class (system.schedule)
- Setup | Monitoring | Scheduled Jobs to list the above Scheduled Job
Recent Comments