4

Are Scheduled Jobs copied after Sandbox Refresh? I did a refresh of a full copy sandbox and looked at the scheduled jobs but not all of them are there. Anyone has any ideas of the criteria used to copy scheduled jobs?

2
  • [Update] After some help from @Jeff Bennett I found out that the CronJobDetail was there but the CronTrigger record wasnt. There were some CronTrigger records but for some reason their CronJobDetailId did not match any of the existing CronJobDetail. In my case I needed to make sure these jobs did not run so I run System.abortJob(id) on the triggers but it would still be nice to know what is happening.
    – d0001
    Commented Jul 28, 2017 at 22:20
  • We've already established there was something wrong with the way your sandbox was refreshed. Therefore this could be caused by any number of undocumented things. You're probably better off speaking with whoever is holding your Salesforce ticket. Sorry I can't be more helpful. Commented Jul 31, 2017 at 14:42

2 Answers 2

5

They should all be there. I had to open a ticket with Salesforce recently because a glitch during a full copy sandbox refresh meant that it was refreshed without all of the Scheduled Jobs listed on that page.

If you are trying to schedule a job and you receive an error message which states it has already been scheduled, try querying for CronJobDetail objects to see if there are any that have no CronTrigger objects associated with them. If there are any, you will have to submit a ticket to Salesforce to have one of their techs go and clear it out.

2
  • Thanks for the CronJobDetail; they are there but don't appear on the UI.
    – d0001
    Commented Jul 28, 2017 at 21:40
  • Jeff, please see my updated message. Any ideas?
    – d0001
    Commented Jul 28, 2017 at 22:21
0

There are two Standard objects which records are required for Scheduled Jobs to be displayed on UI.

One standard object is "CronTrigger". Another is "AsyncApexJob". CronTrigger records are copied upon sandbox refresh while AsyncApexJob are not copied.

So the solution is to copy them manually or reschedule on sandbox.

In the past I developed a package to copy scheduled jobs. Later I abandoned that project.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .