ffscpq.CloneEstimateService
global with sharing class CloneEstimateService
A service that provides functionality to clone estimates.
Methods
cloneEstimateAsync
global static ffscpq.CloneEstimateService.CloneEstimateResponse cloneEstimateAsync(ffscpq.CloneEstimateService.CloneEstimateRequest request)
A method that clones an estimate asynchronously.
Input Parameters
Return Value
This service returns a CloneEstimateResponse.
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | Id sourceEstimateId = 'a52DK000006LEDfYAO' ;
ffscpq.CloneEstimateService.CloneEstimateRequest request = new ffscpq.CloneEstimateService.CloneEstimateRequest(
sourceEstimateId
);
request.Name = 'New estimate' ;
request.OpportunityId = '006DK00000E8LNfYAN' ;
ffscpq.CloneEstimateService.CloneEstimateResponse response = ffscpq.CloneEstimateService.cloneEstimateAsync(
request
);
System.debug( 'Source estimate Id: ' + response.SourceEstimateId);
System.debug( 'Created estimate Id: ' + response.EstimateId);
System.debug( 'Async apex job Id: ' + response.JobId);
|
ffscpq.CloneEstimateService.CloneEstimateRequest
global with sharing class CloneEstimateRequest
The request structure for cloning estimates.
Properties
SourceEstimateId |
Id |
The Id of the Estimate that will be cloned.
|
Name |
String |
[Optional] The name of the cloned estimate. If left blank the name will be copied from the source estimate.
|
OpportunityId |
String |
[Optional] The opportunity associated with the new estimate. This opportunity must be of the same currency as the source estimate. If the source estimate is a template this must not be populated. If left blank the opportunity will be copied from the source estimate.
|
Methods
CloneEstimateRequest
global CloneEstimateRequest(Id sourceEstimateId)
Input Parameters
sourceEstimateId |
Id |
An Id of an Estimate that will be cloned. |
ffscpq.CloneEstimateService.CloneEstimateResponse
global with sharing class CloneEstimateResponse
The result returned after cloning an estimate.
Properties
SourceEstimateId |
Id |
The Id of the estimate that has been cloned.
|
EstimateId |
Id |
The Id of the cloned estimate.
|
JobId |
Id |
The Id of the clone estimate async apex job.
|
Methods
ffscpq.CloneEstimateService.CloneEstimateValidationException
global with sharing class CloneEstimateValidationException extends Exception
The error that occurred while validating the request.
|