Running ad-hoc batch jobs
There are several jobs that you can run at any time of the day, as required. For some batch jobs, one instance of the job may be required to complete before the next instance of the same batch job can be run. For example, if the Billing job is running, you cannot execute another Billing job in parallel. This control is needed for certain jobs that update the org state, and lenders may not want parallel instances of such jobs to run.
However, there are jobs that may be required to run in parallel, and that do not process the same set of data. For example, multiple jobs for processing Metro 2 files can be run in parallel. This can be achieved by classifying the parallel instances as child jobs of the same job, in the MFIFlexJob Apex class. When the Metro2 job is scheduled, it identifies if child instances are needed to be run, and creates the required number of child instances. All these instances are executed in parallel. For this, the Metro2 class sets canRunParallelJobInstances = True, and then sets isChildInstance = True on each child instance that runs in parallel.
For information on the different types of batch jobs, refer to section Definition of Batch Jobs.
Prerequisites
None.
Steps
Perform the following steps to run a batch job manually:
- Log in to your Salesforce account.
- Click Servicing Configuration.
- Go to User and Data, Batch Jobs, Run Batch Jobs.
- In the Select Job tab, select the job you want to run, and click Next. You can select only one job at a time.
- In the Select Records tab, select the records that must be processed by the job. For example, select All Records if the job must process all records.
- Click Run to run the job.