pse.APIActualsServiceglobal with sharing class APIActualsService This class contains methods and structures that can be used to automate processes surrounding actuals calculations. Methods
processTransactionDeltasglobal static pse.APICommonsService.BatchStatus processTransactionDeltas() Immediately starts the job to process transaction deltas. If the job is set to continuous mode it will return null. The status property of the return object is 'Batched' if the job is started successfully, or 'Error' if the job failed. Return ValueThis service returns an APICommonsService.BatchStatus object that contains the Id of the new job if using batch, which you can query to monitor its progress. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. pse.APICommonsService.BatchStatus bs = pse.ProcessTransactionDeltas(); if (bs.status == 'Error') { System.debug('Oh no! ' + bs.errorMessage); return; } //Wait a bit... AsyncApexJob job = [SELECT Id, Status FROM AsyncApexJob WHERE Id =: bs.jobID]; System.debug('Status: ' + job.Status); recalcProjectActualsByProjectsglobal static pse.APICommonsService.BatchStatus recalcProjectActualsByProjects(pse.APIActualsService.ActualsContextRecalcProjectActualsByProjects actualsContext) Recalculates project actuals for the specified projects. This process has several chained steps that begin after the current Apex transaction completes.
Input Parameters
Return ValueSee APICommonsService.BatchStatus for how to check the result of the call. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. List<pse__Proj__c> projectsToRecalculate = [SELECT Id FROM pse__Proj__c WHERE pse__Region__r.Name = 'Spain' AND pse__Stage__c = 'In Progress']; Set<Id> targetIds = new Set<Id>(); for (pse__Proj__c proj : projectsToRecalculate) { targetIds.add(proj.Id); } //Prepare param pse.APIActualsService.ActualsContextRecalcProjectActualsByProjects actualsContext = new pse.APIActualsService.ActualsContextRecalcProjectActualsByProjects(); actualsContext.projectIds = targetIds; //Call service pse.APICommonsService.BatchStatus bs = pse.APIActualsService.recalcProjectActualsByProjects(actualsContext); recalcProjectActualsWithActualsNeedsRecalcglobal static pse.APICommonsService.BatchStatus recalcProjectActualsWithActualsNeedsRecalc(pse.APIActualsService.ActualsContextRecalcProjectActualsWithActualsNeedsRecalc actualsContext) Recalculates project actuals on projects where the Actuals: Needs Recalc checkbox is selected. The parameter can further restrict the project actuals to be recalculated. The process steps are identical to recalcProjectActualsByProjects. See that method for details. Input Parameters
Return ValueSee APICommonsService.BatchStatus for how to check the result of the call. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. You need to provide some sample code pse.APIActualsService.ActualsContextRecalcProjectActualsByProjectsglobal inherited sharing class ActualsContextRecalcProjectActualsByProjects extends APICommonsService.BatchContext A structure containing the projects to recalculate actuals for. Used as the parameter for RecalcProjectActualsByProjects. This class extends pse.APICommonsService.BatchContext Properties
pse.APIActualsService.ActualsContextRecalcProjectActualsWithActualsNeedsRecalcglobal inherited sharing class ActualsContextRecalcProjectActualsWithActualsNeedsRecalc extends APICommonsService.BatchContext A structure containing the Ids of regions, practices, groups and accounts to recalculate project actuals for, where the Actuals Needs Recalc checkbox is selected. This class extends pse.APICommonsService.BatchContext Properties
|