Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

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
1SCHEDULE_FUND_CALCULATION
Available version
55.0
Apex Request Example
1// name of the salesorg for which the job should be scheduled
2String salesOrg = '0001';
3<namespace>.ScheduleFundCalculationCallout callout = new <namespace>.ScheduleFundCalculationCallout(salesOrg);
4
5// Log Transaction Id
6String txId = <namespace>.TransactionHandler.getTransactionIdentifier();
7
8// Job object
9<namespace>.Job job = new <namespace>.Job();
10job.JobChainName = 'TPM_Calculation_Chain_<timestamp>';
11job.JobName = 'FundCalculation';
12job.BatchChainType = 'default';
13job.JobThreads = 25; // ⚡ ADD: Number of parallel workers (default: 5, max: 25 on production/full copy sandbox, 3 on other sandboxes)
14
15// Account Plans in Scope
16List<cgcloud__Fund__c> fundsToCalculate = [
17    SELECT Id FROM cgcloud__Fund__c 
18    // WHERE cgcloud__Sales_Org__c = :salesOrg 
19    // AND ... 
20];
21
22<namespace>.OffplatformCalloutResponse response = callout.execute(txId, job, fundsToCalculate);
23
24if (response.status != 200) {
25   // Handle error
26}