---
schema_version: "1"
id: 611e3413fe26fa55d99c09fc8f793a51b9442bd14d6c4ae4326988f01a1ae710
title: Begin Job Scheduling Transaction
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/retail_api/cgtpm_begin_job_sch_transaction.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/cgtpm_begin_job_sch_transaction.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: c2a692f27b196224df58cb6e32adb4d6edb6bf72ff4c1f384d4a955c98e931f8
description: 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.
---
# Begin Job Scheduling Transaction

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.

![Note](https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/images/icon_note.png)

#### Note

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).

## Resource

BEGIN\_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.

<namespace>.BeginPromotionImportCallout callout = new <namespace>.BeginPromotionImportCallout();

// Import Id, the promotion import is grouped under this ID
String importId = '12345678-1234-1234-1234-123456789012'; 
// Number of promotions to be imported
Integer nrOfItems = 100;
// Timeout in seconds: number of seconds between two schedule promotion callouts
// for this import
Integer timeout = 400;

<namespace>.OffplatformCalloutResponse response = callout.execute(importId, nrOfItems, timeout);

if (response.status != 200) {
   // Handle error
}

Generic is used in the calculation chain flow.

// name of the salesorg for which the job must be scheduled
String salesOrg = '0001';
<namespace>.JobSchedulingBeginCallout callout = new <namespace>.JobSchedulingBeginCallout(salesOrg);

// Log Transaction Id
String txId = <namespace>.TransactionHandler.getTransactionIdentifier();

// Job object
<namespace>.Job job = new <namespace>.Job();
job.JobChainName = 'TPM\_Calculation\_Chain\_<timestamp>';
job.JobName = 'PromotionCalculation';

// Timeout in seconds: number of seconds between two schedule promotion callouts
// for this import
Integer timeout = 350;

<namespace>.OffplatformCalloutResponse response = callout.execute(txId, job, timeout);

if (response.status != 200) {
   // Handle error
}