function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kevincar64kevincar64 

Scheduled Apex

Hi,

 

I scheduled a simple little "Hello Word" app that does a System.debug("Hello World") -- The scheduling returns fine, but the job never shows up in the "All Scheduled Jobs" list and the class never seems to fire (a debug log isn't produced).  I'm running as sys admin with Author Apex enabled - Any help is appreciated.

 

Class:

 

global class HelloWorld implements Schedulable {
 
    global void execute(SchedulableContext ctx) {
        System.debug('Hello World');
        }
}

 I executed the code below in the developer console:

 

APEX_CODE,FINEST;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
Execute Anonymous: public class HWScheduler {
Execute Anonymous:    public void HWScheduler() {}
Execute Anonymous:    public  void start() {
Execute Anonymous:      HelloWorld hw = new HelloWorld();
Execute Anonymous:      String sch = '0 15 13 3 * ? 2012';
Execute Anonymous:      System.schedule('B Hello Test',   sch, hw);
Execute Anonymous:      }
Execute Anonymous:    }
14:54:35.065 (65716000)|EXECUTION_STARTED
14:54:35.065 (65727000)|CODE_UNIT_STARTED|[EXTERNAL]|execute_anonymous_apex
14:54:35.066 (66237000)|STATEMENT_EXECUTE|[1]
14:54:35.066 (66246000)|STATEMENT_EXECUTE|[1]
14:54:35.343 (66282000)|CUMULATIVE_LIMIT_USAGE
14:54:35.343|CUMULATIVE_LIMIT_USAGE_END

14:54:35.066 (66295000)|CODE_UNIT_FINISHED|execute_anonymous_apex
14:54:35.066 (66301000)|EXECUTION_FINISHED
ClintLeeClintLee

Looks like you created a class with a start() method, but I don't see where you ever called the start() method on the HWScheduler class.

 

Just try entering this into the developer console:

 

String sch = '0 15 13 3 * ? 2012';

System.schedule( 'B Hello Test', sch, new HelloWorld() );

 

Hope that helps!

 

Clint