pse.RevenueForecastServiceglobal with sharing class RevenueForecastService This service provides the functionality relating to revenue forecasts. Methods
runForOpportunitiesAsyncglobal static pse.RevenueForecastService.RunForOpportunitiesAsyncResponse runForOpportunitiesAsync(pse.RevenueForecastService.RunForOpportunitiesAsyncRequest request) Enqueues the Revenue Forecast Apex job to asynchronously process opportunities marked as Revenue Forecast Batch Update Pending. If opportunity IDs are provided, it will mark those opportunities as Revenue Forecast Batch Update Pending before scheduling the Apex job. Input Parameters
Return ValueThe result of the operation. 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. Opportunity[] opportunities = [SELECT Id FROM Opportunity LIMIT 10]; Set<Id> opportunityIds = new Map<Id, SObject>(opportunities).keySet(); pse.RevenueForecastService.RunForOpportunitiesAsyncRequest request = new pse.RevenueForecastService.RunForOpportunitiesAsyncRequest( opportunityIds ); pse.RevenueForecastService.RunForOpportunitiesAsyncResponse response = pse.RevenueForecastVersionService.runForOpportunitiesAsync(request); for (Opportunity opportunityRecord : opportunities) { Boolean success = response.getSuccess(opportunityRecord.Id); } runForProjectsAsyncglobal static pse.RevenueForecastService.RunForProjectsAsyncResponse runForProjectsAsync(pse.RevenueForecastService.RunForProjectsAsyncRequest request) Enqueues the Revenue Forecast Apex job to asynchronously process projects marked as Revenue Forecast Batch Update Pending. If project IDs are provided, it will mark those projects as Revenue Forecast Batch Update Pending before scheduling the Apex job. Input Parameters
Return ValueThe result of the operation. 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__Proj__c[] projects = [SELECT Id FROM pse__Proj__c LIMIT 10]; Set<Id> projectIds = new Map<Id, SObject>(projects).keySet(); pse.RevenueForecastService.RunForProjectsAsyncRequest request = new pse.RevenueForecastService.RunForProjectsAsyncRequest( projectIds ); pse.RevenueForecastService.RunForProjectsAsyncResponse response = pse.RevenueForecastVersionService.runForProjectsAsync(request); for (pse__Proj__c project : projects) { Boolean success = response.getSuccess(project.Id); } pse.RevenueForecastService.RunForOpportunitiesAsyncRequestglobal with sharing class RunForOpportunitiesAsyncRequest The request structure for creating revenue forecasts for opportunities. Properties
Methods
RunForOpportunitiesAsyncRequestglobal RunForOpportunitiesAsyncRequest() A constructor that creates a new RunForOpportunitiesAsyncRequest instance. RunForOpportunitiesAsyncRequestglobal RunForOpportunitiesAsyncRequest(Set<Id> opportunityIds) A constructor that creates a new RunForOpportunitiesAsyncRequest instance. Input Parameters
pse.RevenueForecastService.RunForOpportunitiesAsyncResponseglobal with sharing class RunForOpportunitiesAsyncResponse The response structure from creating revenue forecasts for opportunities. Properties
Methods
RunForOpportunitiesAsyncResponseglobal RunForOpportunitiesAsyncResponse() A constructor that creates a new RunForOpportunitiesAsyncResponse instance. getSuccessglobal Boolean getSuccess(Id opportunityId) Indicates whether the given opportunity was successfully marked as Revenue Forecast Batch Update Pending. Input Parameters
Return ValueTrue if the forecast was successfully created for a given opportunity ID. getErrorsglobal List<String> getErrors(Id opportunityId) Lists the errors encountered while marking the given opportunity as Revenue Forecast Batch Update Pending. Input Parameters
Return ValueThe list of errors for the given opportunity ID. getAllErrorsByOpportunityIdglobal Map<Id, List<String>> getAllErrorsByOpportunityId() Lists the errors encountered while marking the given opportunities as Revenue Forecast Batch Update Pending and enqueuing the Revenue Forecast Apex job. Return ValueThe list of errors for the given Opportunity ID. pse.RevenueForecastService.RunForProjectsAsyncRequestglobal with sharing class RunForProjectsAsyncRequest The request structure for creating revenue forecasts for projects. Properties
MethodsRunForProjectsAsyncRequestglobal RunForProjectsAsyncRequest() A constructor that creates a new RunForProjectsAsyncRequest instance. RunForProjectsAsyncRequestglobal RunForProjectsAsyncRequest(Set<Id> projectIds) A constructor that creates a new RunForProjectsAsyncRequest instance. Input Parameters
pse.RevenueForecastService.RunForProjectsAsyncResponseglobal with sharing class RunForProjectsAsyncResponse The response structure from creating revenue forecasts for projects. Properties
Methods
RunForProjectsAsyncResponseglobal RunForProjectsAsyncResponse() A constructor that creates a new RunForProjectsAsyncResponse instance. RunForProjectsAsyncResponseglobal RunForProjectsAsyncResponse(Map<Id, List<String>> errorsByProjectId, Boolean usingUnsupportedRevManVersion) A constructor that creates a new RunForProjectsAsyncResponse instance. getSuccessglobal Boolean getSuccess(Id projectId) Indicates whether the given project was successfully marked as Revenue Forecast Batch Update Pending. Input Parameters
Return ValueTrue if the forecast was successfully created for a given project ID. getErrorsglobal List<String> getErrors(Id projectId) Lists the errors encountered while marking the given project as Revenue Forecast Batch Update Pending. Input Parameters
Return ValueThe list of errors for the given project ID. getAllErrorsByProjectIdglobal Map<Id, List<String>> getAllErrorsByProjectId() Lists the errors encountered while marking the given projects as Revenue Forecast Batch Update Pending and enqueuing the Revenue Forecast Apex job. Return ValueThe list of errors for the given project ID. |