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 hob 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'; 13 14// Account Plans in Scope 15List<cgcloud__Fund__c> fundsToCalculate = [ 16 SELECT Id FROM cgcloud__Fund__c 17 // WHERE cgcloud__Sales_Org__c = :salesOrg 18 // AND ... 19]; 20 21<namespace>.OffplatformCalloutResponse response = callout.execute(txId, job, fundsToCalculate); 22 23if (response.status != 200) { 24 // Handle error 25}