Private
Readonly
loggerPrivate
Readonly
queryPrivate
Readonly
salesforceRest
...ids: string[]IDs of the jobs to abort
Await the completion of a batch class and optionally log it's progress
Optional
options: BatchAwaitOptions | ((status) => 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
Optional
predicate: ((job) => boolean)Optional 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
predicate to narrow the batches to await.
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
Optional
options: BatchExecuteOptionsExecute a batch class and returns an awaitable promise, shortcut for
Class name
Optional
options: BatchExecuteOptions & BatchAwaitOptionsBatch execute and await options
Get a list of all queued and active batches.
Optional
condition: 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
Rest
...classNames: string[]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