3

I'm new to SalesForce development, so forgive my if this question doesn't make sense.

I've opened my org in sales force and have synchronized labels, classes, pages, custom objects and triggers and have added them to source control.

I am now trying to use the deployment tool to move changes to our staging sandbox. If I limit my scope to just labels, everything works as planned so I know that I'm at least on the right path. However, when I try to move everything I seem to be getting "chicken and egg problems" in that one item has a dependency on another. My Package file looks like this

<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
    <members>*</members>
    <name>ApexClass</name>
</types>
<types>
    <members>*</members>
    <name>CustomLabels</name>
</types>
<types>
    <members>*</members>
    <name>CustomObject</name>
</types>
<types>
    <members>*</members>
    <name>ApexPage</name>
</types>
<types>
    <members>*</members>
    <name>ApexTrigger</name>
</types>
<types>
    <members>*</members>
    <name>CustomLabels</name>
</types>
<version>27.0</version>

And the latest error I am seeing is several dozen "Schedulable class has jobs pending or in progress" against different class names. If I try to skip classes, pages wont deploy as they have a dependency on the classes (it appears). Everything I have found on google suggests that this problem was fixed, so my first assumption is that I am doing something wrong.

Is my source control strategy correct? Or is there a better way to get whatever I am missing. And is my package.xml file correct?

Thanks Joe

1

you have 2 options 1) Change set route: (Not tested) Read and heard from my deployment team that you can deploy without deleting the scheduled jobs.

2) Using ANT but after deleting the scheduled job: The error means that of the classes you are trying to push one (or) many of them have scheduled jobs in progress

To check if there are scheduled jobs go to setup--> monitoring --> Scheduled Jobs

Look for the jobs that have a manage label next to the job name and click on manage and see if the class is one of the classes you are trying to deploy.

VERY IMPORTANT: Make sure you see what is the scheduled time in the job because once you deploy the class you have to recreate the job.After this delete the job deploy your class and schedule the job again.

To schedule the job go to setup--> develope --> apex classes ( on the top there should be a schedule apex button click on to choose class and cron timings.

enter image description here

Once your jobs are out of the way you can deploy the classes, pages all together and schedule the job again

  • 1
    You can deploy classes without deleting the scheduled jobs? How do we do it? – Prady Jun 20 '13 at 6:32
  • @Prady,Have heard that using changesets will let you deploy without deleting scheduledd jobs ( not tested) I will test in my org and update my answer – Rao Jun 20 '13 at 13:02
  • i think i had tried once using changeset sometime back and it failed. Let me know if it was successful for you – Prady Jun 20 '13 at 16:46
  • Took me a while to determine which job to cancel (there were about 25 listed), but it was job around Scheduled Apex. Thanks for the details and screen shot – Joe Jun 21 '13 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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