3

I have a scheduled class which in turn calls a Database.executeBatch to start a batch class. I am trying to make some edits to batch class and I am receiving well known "schedulable class has jobs pending or in progress" error message when saving batch class. Based on below article, https://help.salesforce.com/HTViewSolution?id=000004423&language=en_US

I have

  1. deleted all scheduled jobs that are under Setup -> Monitoring -> scheduled jobs
  2. Also made sure that there are no jobs in queued status

.

SELECT ApexClassId, CreatedDate, ExtendedStatus, Id, JobItemsProcessed, JobType, MethodName, ParentJobId, Status, TotalJobItems 
FROM AsyncApexJob 
WHERE status!='Completed' AND status!='Aborted' AND status != 'Failed'

Above query is returning count as 0.

I have only 1 entry in CronTrigger table where State is "ACQUIRED" and CronJobDetail.Name is null. I tried to call abortjob on this entry but I get an error - Invalid parameter value "000000000000000" for parameter "id") when I run abortjob.

Any idea if this Crontrigger entry is preventing edits to batch class ?

  • Is this a sandbox? Have you refreshed recently? – sfdcfox Sep 2 '15 at 14:29
  • You will need to contact support as mentioned int he answer this is a duplicate of. – Eric Sep 2 '15 at 14:36
  • I did reach out to support and they did clear the entry in CronTrigger that i mentioned in my question. After this i am able to edit the class. SFDC Support directed me to - success.salesforce.com/issues_view?id=a1p300000008XotAAE – apn Sep 2 '15 at 23:08
0

Yes, the entry can prevent you from editing the class.

This is known issue and there's workaround described by Dan Appleman in the following webinar: Design Patterns for Asynchronous Apex. There's a link to the code containing the pattern that prevents this from happening at http://advancedapex.com/dreamforce13/.

  • @sfdcfox - yes this is sandbox but it was refreshed around a month back. interestingly , another developer is using the same sandbox and creating some separate batch class. he is able to edit his batch class but I ( and others) am not able to edit my class. – apn Sep 2 '15 at 16:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.