Newer Version Available
Schedule Account Plan Calculation V2
Schedules the calculation of account plans. Batch chains
support editable account plans. It can schedule up to 500 account plan IDs for
calculation.
Use this endpoint to calculate the Account Plan, which is handled by Customer Business Plans when creating a new project. See Calculation of Account Plans and Customer Business Plans.
- Resource
-
1SCHEDULE_ACCOUNT_PLAN_CALCULATION_V2 - Available version
- 55.0
- Apex Request Example
-
Baseline Plan Calculation
1// name of the salesorg for which the hob should be scheduled 2String salesOrg = '0001'; 3<namespace>.ScheduleAccountPlanCalculationV2Callout callout = new <namespace>.ScheduleAccountPlanCalculationV2Callout(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 = 'AccountPlanCalculationBasic'; 12job.BatchChainType = 'default'; 13 14// Account Plans in Scope 15List<cgcloud__Account_Plan__c> accountPlansToCalculate = [ 16 SELECT Id FROM cgcloud__Account_Plan__c WHERE cgcloud__Sales_Org__c = :salesOrg 17 // AND ... 18]; 19 20<namespace>.ScheduleAccountPlanCalculationV2Callout.Options options = new <namespace>.ScheduleAccountPlanCalculationV2Callout.Options(); 21options.writebacksubsets = new List<String> { 'basic' }; 22options.cleanupobsoletemeasures = false; 23 24 25<namespace>.OffplatformCalloutResponse response = callout.execute(txId, job, accountPlansToCalculate, options); 26 27if (response.status != 200) { 28 // Handle error 29} -
BusinessPlan Calculation
1// name of the salesorg for which the hob should be scheduled 2String salesOrg = '0001'; 3<namespace>.ScheduleAccountPlanCalculationV2Callout callout = new <namespace>.ScheduleAccountPlanCalculationV2Callout(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 = 'AccountPlanCalculationBusinessPlan'; 12 13// Account Plans in Scope 14List<cgcloud__Account_Plan__c> accountPlansToCalculate = [ 15 SELECT Id FROM cgcloud__Account_Plan__c WHERE cgcloud__Sales_Org__c = :salesOrg 16 // AND ... 17]; 18 19<namespace>.ScheduleAccountPlanCalculationV2Callout.Options options = new <namespace>.ScheduleAccountPlanCalculationV2Callout.Options(); 20options.writebacksubsets = new List<String> { 'businessplan' }; 21options.cleanupobsoletemeasures = false; 22 23 24<namespace>.OffplatformCalloutResponse response = callout.execute(txId, job, accountPlansToCalculate, options); 25 26if (response.status != 200) { 27 // Handle error 28}