pse.APIActualsServiceglobal with sharing class APIActualsService This class contains methods and structures that can be used to automate processes surrounding actuals calculations. EnumsActualsProcessType
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 getActualsAppLogsglobal static List<appirio_core__App_Log__c> getActualsAppLogs(pse.AppLogQueryContext queryContext) Returns app logs that are related to actuals calculations, filtered by the provided query context. Input Parameters
Return ValueA list of App Log records matching the criteria. getActualsLockStatusglobal static pse.APIActualsService.ActualsLockStatus getActualsLockStatus() Returns the current lock status of actuals process, including the name of the process holding the lock. When actuals are unlocked, the lockSource property is null. Return ValueAn ActualsLockStatus object containing whether actuals are locked and the name of the locking process. getRecalculationStatusglobal static pse.APIActualsService.RecalculationStatus getRecalculationStatus() Returns the status and types of actuals recalculation processes. This includes UI-driven recalculation (Actuals Verifier, Project Actuals Recalculation, Resource Actuals Recalculation, RPG Actuals Recalculation) and hierarchy-change recalculation. Return ValueA RecalculationStatus object containing whether recalculation is in progress and the types of recalculation. 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
pse.APIActualsService.ActualsLockStatusglobal with sharing class ActualsLockStatus Stores the current lock status of actuals process. Properties
pse.APIActualsService.RecalculationStatusglobal with sharing class RecalculationStatus Represents the status and types of actuals recalculation processes. Properties
|