Steps to Schedule Apex

  1. Define Scheduled Apex Class
  2. global class scheduledMerge implements Schedulable{
    global void execute(SchedulableContext SC) {
    mergeNumbers M = new mergeNumbers();
    }}

  3. Run the system.schedule Anonymous Code to Schedule the Apex Class (Read More on System.Schedule @ http://tinyurl.com/yg2d7qj)
  4. Setup | Monitoring | Scheduled Jobs to list the above Scheduled Job

Steps to Update Scheduled Apex Code

  1. Delete the Scheduled Job from Setup | Monitoring | Scheduled Jobs
  2. 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)
  3. Run the Anonymous Code to Schedule the Apex Class (system.schedule)
  4. Setup | Monitoring | Scheduled Jobs to list the above Scheduled Job