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 

NameTypeDescriptionRequired or Optional
jobChainStringID of the job chain record.Required
jobIdStringID of the job record for which scheduling transaction is to be started.Required

Apex Request Example 

1// name of the salesorg for which the job should be scheduled
2String salesOrg = '0001';
3<namespace>.JobSchedulingCommitCallout callout = new <namespace>.JobSchedulingCommitCallout(salesOrg);
4// Log Transaction Id
5String txId = <namespace>.TransactionHandler.getTransactionIdentifier();
6// Job object
7<namespace>.Job job = new <namespace>.Job();
8job.JobChainName = 'TPM_Calculation_Chain_<timestamp>';
9job.JobName = 'PromotionCalculation';
10<namespace>.OffplatformCalloutResponse response = callout.execute(txId, job);
11if (response.status != 200) {
12   // Handle error
13}