IDs of the jobs to abort
Cancel all active batches of the specified type
list of class names
Await the completion of a batch class and optionally log it's progress
Id of the batch job to await or filter condition
Optionaloptions: BatchAwaitOptions | ((status: SalesforceBatchJobStatus) => any)Track batches created scheduled from now and allow those batches to be queried and awaited. By default the tracker will track all batches created by the current user. Use the optional
Optionalpredicate: (job: SalesforceBatchJob) => booleanOptional predicate which filters the batches to await; if the predicate returns false the batch is ignored otherwise it is awaited
Object with a scheduledBatches property which returns a promise which resolves to an array of scheduled batches and a awaitScheduledBatches method which awaits all scheduled batches
const tracker = await batchService.createBatchTracker(job => job.apexClass === 'MyBatchClass');
salesforceService.executeAnonymous('System.scheduleBatch(new MyBatchClass(), \'MyBatchClass\', 1);');
salesforceService.executeAnonymous('System.scheduleBatch(new MyNonAwaitedBatchClass(), \'MyNonAwaitedBatchClass\', 1);');
await tracker.awaitScheduledBatches();
Execute a batch class and return the ID of the scheduled batch job or throws an error when the job cannot be scheduled.
Class name
Optionaloptions: BatchExecuteOptionsOptions for executing the batch (params are passed to the constructor)
Execute a batch class and returns an awaitable promise, shortcut for executeBatch and awaitBatchJob *
Class name *
Optionaloptions: BatchExecuteOptions & BatchAwaitOptionsBatch execute and await options *
Get a list of all queued and active batches.
Optionalcondition: QueryFilterConditionList of active or queued batches
Get a list of all queued and active batches.
List of active or queued batches
Get a list of all queued and active batches that match the specified class names; note class names should be specified are without namespace prefix
List of active or queued batches
Get all batch jobs optionally applying the specified condition to the tooling query
Optional filter condition that is applied to the query builder or a batch job ID or APEX class name of the batch job without namespace prefix
List of batch jobs sorted by created data from newest to oldest
Get the status of the batch job as status object
ID of the batch job or a filter condition
Status of the batch
Aborts a running APEX job with the specified ID, get batch jobs IDs using getBatchJobs, getActiveBatchJobs or getActiveBatchJobsOfType.