When Jobs Go Bad...
Job classes are written to run over and over again, processing a well-known script of actions. However, everything is not up to that job class and everything doesn't always go as planned!
Let's take the Community Updates job for example. When a new user registers with the company's customer portal, an integration pushes the new user profile data to Salesforce. The Community Updates job is a Schedulable class that periodically "processes" these new records and prepares them for the sales and support teams.
When the customer portal platform is updated, its API changes so that it is now broadcasting updates to users, as well as their initial registration.
Because of the clever and fantastic development and logging of the Community Updates JC Job, the administrator notices that its last run "Needs Review." After looking at the custom logs, it is clear that this new update to the API (thanks for telling us, customer portal platform team!) has begun to create duplicates in Salesforce, at an alarming rate!
The administrator has to act fast to stop the madness, so that Salesforce data is not compromise and so that the Salesforce and data teams don't spend the next three weeks in meetings, trying to sort out the data mess that was created.
Usually, fixing the live data problem requires a hasty develop and deploy action. Proper process and testing procedures may be circumvented with the "It's an emergency!" excuse. We all squint our eyes and move forward with the "fix", hoping side effects don't pop up during the mad dash.
Everything is gonna be alright
With Job Center, there is a simpler way to get things under control. Using the Bypass function, any Job Center administrator can "pause" the Community Updates job, until a proper resolution can be found and implemented. To use the Bypass function, a Job Center admin simply goes to the Job List page and finds the Community Updates Job.
Once there, a simple click of the "Bypass" button (on the Manage tab), and the Community Updates job can't hurt the data anymore! Once a proper resolution has been implemented in the Class (say, filtering out update records) and deployed, the Community Updates job can be reactivated with one click, and it will continue as before.
What Happens During the Bypass?
To avoid confusion, Job Center will continue to capture every attempt to run the Community Updates job. In other words, the schedule for running the job does not stop. However, when the job is executed, it will "bypass" the meaty part of the code, so that none of the functionality of the job actually executes.
The Job Run will still be logged and the Live Stream will still record the attempt, so that users and administrators don't think it is just failing to run altogether.
Bypassing jobs is a really simple functionality, and easy to use. It allows us to suspend/pause/skip individual executions of JC Jobs, so that we can avoid run away jobs, catastrophic data loss, and other undesirable conditions.