Newer Version Available

This content describes an older version of this product. View Latest

Commit Job Scheduling Transaction

Explicitly commit an open scheduling transaction for a job in a job chain.
Resource
1COMMIT_JOB_SCHEDULING_TRANSACTION
Available version
55.0
Request Parameters
Name Type Description Required or Optional
jobChain String ID of the job chain record. Required
jobId String ID of the job record for which scheduling transaction is to be started. Required
Apex Request Example
1// name of the salesorg for which the hob should be scheduled
2String salesOrg = '0001';
3<namespace>.JobSchedulingCommitCallout callout = new <namespace>.JobSchedulingCommitCallout(salesOrg);
4
5// Log Transaction Id
6String txId = <namespace>.TransactionHandler.getTransactionIdentifier();
7
8// Job object
9<namespace>.Job job = new <namespace>.Job();
10job.JobChainName = 'TPM_Calculation_Chain_<timestamp>';
11job.JobName = 'PromotionCalculation';
12
13<namespace>.OffplatformCalloutResponse response = callout.execute(txId, job);
14
15if (response.status != 200) {
16   // Handle error
17}