---
schema_version: "1"
id: 6b5457da07a1fca0a4a6f2d10f08d44669739761d517032663f8372dc3e2809f
title: Schedule Account Plan Category Calculation
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/retail_api/cgtpm_schedule_account_plan_category_calc.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/cgtpm_schedule_account_plan_category_calc.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9858c353df87500bde153fd37a3d790416eae512485b80cd32142902c30972f8
description: Schedules one or multiple account plan categories for batch calculation. It accepts up to 1000 account plan categories and schedules them for calculation.
---
# Schedule Account Plan Category Calculation

Schedules one or multiple account plan categories for batch calculation. It accepts up to 1000 account plan categories and schedules them for calculation.

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

#### Note

This endpoint can be used to schedule account plan calculations per category in case customer business plans and the account plan calculation V2 is used.

## Resource

SCHEDULE\_ACCOUNT\_PLAN\_CATEGORY\_CALC

## Available version

55.0

## Apex Request Example

// name of the salesorg for which the job should be scheduled
String salesOrg = '0001';
<namespace>.ScheduleAccountPlanCategoryCalcCallout callout = new <namespace>.ScheduleAccountPlanCategoryCalcCallout (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 = 'AccountPlanCategoryCalculation';
job.BatchChainType = 'default';
job.JobThreads = 25; // ⚡ ADD: Number of parallel workers (default: 5, max: 25 on production/full copy sandbox, 3 on other sandboxes)
// Account Plans in Scope
List<cgcloud\_\_Account\_Plan\_Category\_\_c> accountPlanCategoriesToCalculate = \[
    SELECT Id FROM cgcloud\_\_Account\_Plan\_\_c 
    // WHERE cgcloud\_\_Account\_Plan\_\_r.cgcloud\_\_Sales\_Org\_\_c = :salesOrg 
    // AND ... 
\];
<namespace>.OffplatformCalloutResponse response = callout.execute(txId, job, accountPlanCategoriesToCalculate, options);
if (response.status != 200) {
   // Handle error
}