---
schema_version: "1"
id: 4c19c7c2ee0f6ef8f2a569966f27ac6789b6960bd20dea224379fb68c9a4a807
title: Schedule Fund Calculation
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/retail_api/cgtpm_schedule_fund_calc.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/cgtpm_schedule_fund_calc.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9d412abb04100347d31475fece37560675f06d54439aa328b35dea71c8f0b85e
description: Enqueues a given list of funds for batch calculation. The calculation result is transferred back to Salesforce via the KPI Upload once the calculation is finished.
---
# Schedule Fund Calculation

Enqueues a given list of funds for batch calculation. The calculation result is transferred back to Salesforce via the KPI Upload once the calculation is finished.

## Resource

SCHEDULE\_FUND\_CALCULATION

## Available version

55.0

## Apex Request Example

// name of the salesorg for which the job should be scheduled
String salesOrg = '0001';
<namespace>.ScheduleFundCalculationCallout callout = new <namespace>.ScheduleFundCalculationCallout(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 = 'FundCalculation';
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\_\_Fund\_\_c> fundsToCalculate = \[
    SELECT Id FROM cgcloud\_\_Fund\_\_c 
    // WHERE cgcloud\_\_Sales\_Org\_\_c = :salesOrg 
    // AND ... 
\];
<namespace>.OffplatformCalloutResponse response = callout.execute(txId, job, fundsToCalculate);
if (response.status != 200) {
   // Handle error
}