Salesforce Scheduled Jobs Test
Automated flow in Salesforce is pretty straightforward. In general, the system reacts to data changes or UI events. For example, user update field value – system run validation rules, triggers, flows, etc.
But sometimes we need to activate the flow by time. Such an approach is very handy when we do the same actions over and over.
This is why, Salesforce suggests that you schedule jobs that need to be performed repeatedly. Some of the jobs that are typically scheduled are as follows:
-
Apex jobs: Apex jobs are in fact Apex classes that are scheduled to run at specific times.
-
Batch jobs: Batch Apex is used to run large jobs that would exceed normal processing limits. Using Batch Apex, you can process records asynchronously in batches to stay within platform limits.
-
Dashboard Refresh: A dashboard is typically refreshed to load the latest data into the dashboard. You can schedule a dashboard refresh job to run daily, monthly, or weekly, so you can receive refresh dashboard results by email.
-
Data Export: You can easily export data from Salesforce, either manually or on an automatic schedule. Data export jobs can be scheduled using the Data Export Service - an in-browser service - or the Data Loader - a client application that you must install separately. The Data Export Service helps you schedule the automatic export of data at weekly or monthly intervals. The Data Loader supports a command line, using which you can schedule the automatic export of data.
-
Report Run: You can schedule a report to run at a configured frequency, so you can obtain latest report data without having to generate the report manually.
-
Reporting Snapshot: Salesforce Reporting Snapshots allows you to create and store snapshots of data that you want to monitor using custom objects. You can schedule a reporting snapshot to run daily, weekly, or monthly so that data from the source report is loaded into the target object when you need it.
The success of repetitive actions depends upon the uninterrupted execution of the corresponding scheduled jobs. If a scheduled job is blocked - for eg., a trigger blocking a scheduled apex job - or is paused for any reason, then critical business operations may be delayed as a result. Similarly, errors in execution of scheduled jobs can also impact business. This is why, administrators need to rapidly capture problematic scheduled jobs! Using the Salesforce Scheduled Jobs test, this is now possible!
This test auto-discovers the different types of scheduled jobs that have been configured, and tracks the execution status of the jobs of each type. While at it, the test indicates how many of the jobs submitted for execution actually ran successfully, and how many did not! The test further reveals the type of jobs that did not complete, and the probable reason for the same - is it because the jobs were blocked? paused? encountered errors? or is it because that jobs are still 'waiting' to be executed?
Target of the test : A Salesforce organization
Agent deploying the test : A remote agent.
Outputs of the test : One set of results for every type of scheduled job
Parameters | Description |
---|---|
Test Period |
How often should the test be executed. |
Host |
The host for which the test is to be configured. |
|
This test needs to login to the target Salesforce organization as a user with Administrative rights, in order to run API commands on it and pull metrics. To facilitate this connection, specify the email ID of the Administrator of the Salesforce organization here. |
Password |
Specify the password of the Administrator here. |
Confirm Password |
Confirm the administrator password by retyping here. |
Measurement | Description | Measurement Unit | Interpretation |
---|---|---|---|
Submitted jobs |
Indicates the number of scheduled jobs of this type that have been submitted for execution. |
Number |
|
Planned jobs |
Indicates the number of scheduled jobs of this type that have been planned. |
Number |
|
Waited jobs |
Indicates the number of scheduled jobs of this type that are 'waiting' in the queue to be executed. |
Number |
A high value or a consistent increase in the value of this measure could indicate a bottleneck in job execution. |
Acquired jobs |
Indicates the number of jobs that have been picked up by the system and is about to execute. |
Number |
|
Executing jobs |
Indicates the number of jobs of this type that are currently executing. |
Number |
|
Completed jobs |
Indicates the number of jobs of this type that have completed execution. |
Number |
|
Blocked jobs |
Indicates the number of jobs of this type that have been blocked. |
Number |
A job is blocked if execution of a second instance of the job is attempted while one instance is running. This state lasts until the first job instance is completed. Ideally, the value of this measure should be 0. |
Error jobs |
Indicates the number of jobs of this type for which the trigger definition has an error. |
Number |
Ideally, the value of this measure should be 0. |
Paused jobs |
Indicates the number of jobs of this type that are paused. |
Number |
A job can have this state during patch and major releases. After the release has finished, the job state is automatically set to WAITING or another state. |
Paused blocked jobs |
Indicates the number of jobs of this type that are paused and blocked. |
Number |
A job has this state due to a release occurring. When the release has finished and no other instance of the job is running, the job’s status is set to another state. |
Deleted jobs |
Indicates the number of jobs of this type that are deleted. |
Number |
|