---
schema_version: "1"
id: 978b8592741134740e339eb27ee8603d241a2b61ed7d5bcf762f70d14f46e0da
title: Schedule Rate Based Funding Calculation
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/retail_api/cgtpm_schedule_rate_based_funding_calc.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/cgtpm_schedule_rate_based_funding_calc.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: e77781e5d8bba852c22c3062dd47198513ad80a5ceedce8dd81f2266f3f628ba
description: Schedules a collection of Rate Based Funding (RBF) Objects for calculation.
---
# Schedule Rate Based Funding Calculation

Schedules a collection of Rate Based Funding (RBF) Objects for calculation.

The calculation process creates conditions from the Rate Based Funding calculation results and write them to the account product measures storage. Some KPIs can also be written back to the Rate Based Funding Objects in Salesforce.

## Resource

SCHEDULE\_RATE\_BASED\_FUNDING\_CALCULATION

## Available version

55.0

## Apex Request Example

String salesOrg = '0001'; // Sales Organization name
<namespace>.Job jobInstance = new <namespace>.Job();
Set<Id> rbfIds = new Set<Id>{'rbfId\_1','rbfId\_2'};//Ids from RBF records
jobInstance.JobChainName = 'TPM\_Calculation\_Chain\_'+Datetime.now().getTime();
jobInstance.JobName = 'ScheduleRateBaseFundingJob';
jobInstance.JobModes = new List<String\>{'MapCalculationResultsWithKpiMap','WritebackConditionRecords'};
jobInstance.JobThreads = 25; // ⚡ ADD: Number of parallel workers (default: 5, max: 25 on production/full copy sandbox, 3 on other sandboxes)
List<cgcloud\_\_Rate\_Based\_Funding\_\_c> rbfs = new List<cgcloud\_\_Rate\_Based\_Funding\_\_c>(\[SELECT Id FROM cgcloud\_\_Rate\_Based\_Funding\_\_c WHERE Id IN :rbfIds\]);
<namespace>.ScheduleRBFCalculationCallout callout = new <namespace>.ScheduleRBFCalculationCallout(salesOrg);
<namespace>.OffPlatformCalloutResponse response = callout.execute(
    <namespace>.TransactionHandler.getTransactionIdentifier(), 
    jobInstance, 
    rbfs
);
if (response.status != 200) {
    //Handle error
}