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
NileshANileshA 

Scheduled Jobs Not executing

Hi,

I need to run some Scheduled Jobs in my Apex application. I am able to Schedule the Job and can even see it under

Setup | Monitoring | Scheduled Jobs

Whenever the Schedule occurs, I can see the 'Started' column in the Interface updated accordingly, but nothing happens further. When I had some error in  code I got notified by email, so that works. But now I have no errors and its not executing.

Under 'Setup | Monitoring | Apex Jobs' I see the job Immediately after it is submitted. Strangely it shows the 'Completion Date' even before the schedule occurs and status as 'Completed'

I am using Http Callouts in my Job, and have defined the method with annotation

@future(callout=true)


If I call the method directly without using schedule, It does execute as expected.

Can any one help me debug this. How do I debug what's going wrong in the scheduler. I waited for almost 12hrs after the Job started, but it did not get executed. Also, does any one have an idea about how long does it take approximately for the Job to get executed after it starts, as it is dependent on the' Job queue activity'?

Regards,
Nilesh

 

cloudcodercloudcoder

Can you post your scheduler code so I can have a look?

NileshANileshA

Solved. Sorry for the delayed response.

I had two methods, one which created the schedule and the other which had the actual code which executed when the schedule was exceuted. I had not set annotation

@future(callout=true)

 

for the method that actually exceuted in the schedule. Unfortunately it did not give email notification about this exception.
Thanks cloudcoder.