Begin a scheduling transaction for a job in a job chain. The job either starts an open transaction (if the number of job items is not announced) that must be explicitly committed to, or communicates the expected number of job items to the off-platform system.
Optionally, a scheduling timeout between 30 seconds and 15 minutes can be specified. The default is 5 minutes. This is the time when the scheduling processes must provide the job items. Timeout is calculated from the last time job items were added to the transaction.
The JobThreads parameter is not effective for this endpoint — worker parallelism is controlled by the individual scheduling endpoints (e.g., Schedule Promotion Calculation, Schedule Account Plan Calculation V2).
Note
Resource
1BEGIN_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
PromotionImport is used when you schedule a top promotion by grouping the imported promotions.
1<namespace>.BeginPromotionImportCallout callout = new<namespace>.BeginPromotionImportCallout();23// Import Id, the promotion import is grouped under this ID4String importId = '12345678-1234-1234-1234-123456789012'; 5// Number of promotions to be imported6Integer nrOfItems = 100;7// Timeout in seconds: number of seconds between two schedule promotion callouts8// for this import9Integer timeout = 400;1011<namespace>.OffplatformCalloutResponse response = callout.execute(importId, nrOfItems, timeout);1213if(response.status != 200){14 // Handle error15}
Generic is used in the calculation chain flow.
1// name of the salesorg for which the job must be scheduled2String salesOrg = '0001';3<namespace>.JobSchedulingBeginCallout callout = new <namespace>.JobSchedulingBeginCallout(salesOrg);45// Log Transaction Id6String txId = <namespace>.TransactionHandler.getTransactionIdentifier();78// Job object9<namespace>.Job job = new <namespace>.Job();10job.JobChainName = 'TPM_Calculation_Chain_<timestamp>';11job.JobName = 'PromotionCalculation';1213// Timeout in seconds: number of seconds between two schedule promotion callouts14// for this import15Integer timeout = 350;1617<namespace>.OffplatformCalloutResponse response = callout.execute(txId, job, timeout);1819if (response.status != 200) {20 // Handle error21}