+ Start a Discussion
Kamal Kishore SinghKamal Kishore Singh 

Apex Specialist- Schedule synchronization :

Hi Guys 

I have implemented the below class and also scheduled it . 

Still getting an error. 
Challenge Not yet complete... here's what's wrong: 
The Apex class does not appear to be implementing the execute() method.
Very sad to see was not able to complete in the first attempt after making everything right.

public class WarehouseSyncSchedule implements Schedulable {
  
    public void execute(SchedulableContext SC)
    {
        WarehouseCalloutService.runWarehouseEquipmentSync();
    }
    
}
Kamal Kishore SinghKamal Kishore Singh
It is also scheduled 

6/19/2016 1:50 PMScheduled ApexQueued 000Singh, Kamal WarehouseSyncSchedule 7072800001zrpLT

ActionJob NameSubmitted BySubmittedStartedNext Scheduled RunType
Manage | DelHowWeRollJobSingh, Kamal6/19/2016 1:50 PM 6/20/2016 1:00 AMScheduled Apex
Nitin SharmaNitin Sharma
Hi Kamal,

First create a object for batch class in public void execute method block after this call a method Database.executeBatch(batch class object name). Examlple given below.
global class ScheduleBatch Implements Schedulable 
{
    global void execute(SchedulableContext sc){
        BirthdayNotificationBatch sb = new BirthdayNotificationBatch();
        Database.executeBatch(sb);
    }   
}

Thanks,
Nitin Sharma
Kamal Kishore SinghKamal Kishore Singh
This is not a batch class. WarehouseCalloutService.runWarehouseEquipmentSync(); where runWarehouseEquipmentSync is static method.
Kamal Kishore SinghKamal Kishore Singh
Got the answer for scheduleable class the method should be global. 
As classes installed from manage package is public , you tend to mis this. There change the class and method to global

globalclass WarehouseSyncSchedule implements Schedulable {
  
    global void execute(SchedulableContext SC)
    {
        WarehouseCalloutService.runWarehouseEquipmentSync();
    }
    
}
Naveen ChoudharyNaveen Choudhary
Hi,

Use the following steps sequentially as mentioned : 

1. Create Schedule Apex from the Salesforce UI.

User-added image

2. Use the exact setting mentioned in below image : 
User-added image

3. WarehouseSyncSchedule class should be like this : 
 
global class WarehouseSyncSchedule implements schedulable {
  // implement scheduled code here
  global void execute(SchedulableContext sc){

      WarehouseCalloutService.runWarehouseEquipmentSync();
      
  }
}

This will help you to clear Apex Specialist #3 challenge.

Happy Trail Blazing :) 
Rajesh Ediga 1Rajesh Ediga 1
Can you provide the test class for this for reference to complete Test scheduling logic cahllenge ?
johny Bashajohny Basha
In addition to scheduling the job in WarehouseSyncSchedule . Need to schedule the job daily in Salesforce UI under Apex classes and schedule jobs.
 
Tushar SaxenaTushar Saxena

Hey Naveen,

Can we solve this problem entirely code based.. I mean not scheduling the class using UI.