I have a scheduled class that is seen and setup within the Gui. Setup->Monitoring->Scheduled Jobs
It is set to run everday at 6PM. It shows started and next scheduled run. However, I started it over the weekend and have yet to receive any email from it. The Schedulable class being called is below.
global class DistiAutomationSchedule implements Schedulable {
global void execute(SchedulableContext SC){
AccountPOSTExcelFile A = new AccountPOSTExcelFile();
A.runDistiReports();
}
}
I can run the code withing the schedulable context using the Force.com IDE and Execute anonymously and it runs as it should.
AccountPOSTExcelFile A = new AccountPOSTExcelFile();
A.runDistiReports();
Any help or next debug steps would be very much appreciated.
Best Answer
Per SFDC support below is their response that resolved the issue I was having.
I have investigated and found that the issue started happening after 13 because with summer 13 - Scheduled Apex jobs have an AysncApexJob row, this always stays in the Queued status until the job has no nextfiretime, then it gets marked completed, or if the job is aborted, then the AsyncApexJob row gets marked aborted as well. if it is a job that recurs indefinitely, then it will never get marked as completed. It will only get marked completed if after running the execute method, the cron trigger a nextfiretime of null.( see the summer 13 release note -page 229 https://org62.my.salesforce.com/help/doc/en/salesforce_summer13_release_notes.pdf).
Please try to to abort the current scheduled job in the sche duled class and then schedule it after 1 minute. Please see this sample code.
NOTE This is sample code and not ready for production.
I then altered my code to work with the new format provide above: