Winter 15 – Deployment Features in Apex Schedule class

Are you trying to abort a running job in a production instance and recreating as same as before while deploying?

Are you trying to abort a running job in a production instance and recreating as same as before while deploying?

Here is the new feature to avoid aborting and recreating the job every time.

Currently, if we deploy any components that were referenced by Apex jobs and were in pending or in progress in another organization, it results in deployment failure.

For example, if we deploy an Apex schedule class and there is already a scheduled job that corresponds to this class, we cannot deploy the existing class, and the entire deployment fails and throws an error message as “Schedulable class has jobs pending or in progress“.

To overcome this, we need to abort the job that is running in another organization and need to recreate the new job as same as before, after the deployment process. This involves lot of manual work as well as it consumes more time.

Winter ’15 Feature:
From Winter ’15, we will be having a checkbox named Allow deployments of components when corresponding Apex jobs are pending or in progress.

By enabling this checkbox, we can deploy the components associated with corresponding jobs including scheduled jobs, batch jobs, and future methods without deployment failure.

From Winter ’15, Deployment connections have been renamed to Deployment settings.

sc0610-1.png

Steps to enable the checkbox:
To enable the check box, follow the steps given below

1. From Setup click Deployment Settings
2. Enable the Allow deployments of components when corresponding Apex jobs are pending or in progress checkbox.

sc0610-2.png

3. Click Save.

This option applies to change sets and deployments started through the Metadata API.

By using this Winter ’15 feature, we do not have to abort Apex jobs and do not have to recreate the new job after the deployment process. Hence, it reduces some time consumption as well as manual work. When the size of the organization is higher, a considerable amount of time is saved.

Reference: Salesforce Winter ’15 Release Notes

About MST

At MST Solutions our cornerstone is to adapt, engage and create solutions which guarantee the success of our clients. The talent of our team and experiences in varied business verticals gives us an advantage over other competitors.

Recent Articles

Session Based Permission Sets

A Permission Set is a collection of settings and permissions that give access to users to various tools and functions. The settings and permissions in Permission Sets are additionally found in profiles, but permission sets broaden users’ functional access without altering their profiles.

Read Article »

Work with us.

Our people aren’t just employees, they are key to the success of our business. We recognize the strengths of each individual and allow them time and resources to further develop those skills, crafting a culture of leaders who are passionate about where they are going within our organization.