ffscpq.AddEstimateProductService
global with sharing class AddEstimateProductService
A service that provides functionality related to adding estimate products to estimates.
Methods
addEstimateProductsToEstimates
global static List<ffscpq.AddEstimateProductService.AddEstimateProductsToEstimatesResponse> addEstimateProductsToEstimates(List<ffscpq.AddEstimateProductService.AddEstimateProductsToEstimatesRequest> requests)
A method that adds estimate products to estimates.
Input Parameters
Return Value
This service returns AddEstimateProductsToEstimatesResponse in a list that parallels the input list.
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | Id estimateId = 'a6MDK000000L2fJ2AS' ;
Id estimateProductId = 'a6HDK000000L2uu2AC' ;
ffscpq.AddEstimateProductService.AddEstimateProductsToEstimatesRequest request = new ffscpq.AddEstimateProductService.AddEstimateProductsToEstimatesRequest(
estimateId,
estimateProductId
);
request.EstimateProductInstanceBillingType = 'Fixed Price' ;
request.EstimateProductInstanceFixedPriceMargin = 15 ;
request.Name = 'Delivery & Support' ;
request.StartDate = Date.newInstance( 2023 , 1 , 1 );
List<ffscpq.AddEstimateProductService.AddEstimateProductsToEstimatesResponse> responses = ffscpq.AddEstimateProductService.addEstimateProductsToEstimates(
new List<ffscpq.AddEstimateProductService.AddEstimateProductsToEstimatesRequest>{ request }
);
System.debug( 'The estimate product ID: ' + responses[ 0 ].EstimateProductId);
System.debug( 'The destination estimate ID: ' + responses[ 0 ].EstimateId);
System.debug( 'The ApexJobId: ' + responses[ 0 ].JobId);
System.debug( 'Number of errors: ' + responses[ 0 ].Errors.size());
if (!responses[ 0 ].Errors.isEmpty()) {
System.debug( 'Error message: ' + responses[ 0 ].Errors[ 0 ].Message);
}
|
ffscpq.AddEstimateProductService.IFinalizeEstimateAction
global interface IFinalizeEstimateAction
An action that is executed after all estimate products have been added to an estimate.
Methods
execute
void execute(Id estimateId)
ffscpq.AddEstimateProductService.IFinalizeEstimateProductAction
global interface IFinalizeEstimateProductAction
An action that is executed after the estimate product has been added to the estimate.
Methods
execute
void execute(ffscpq__Estimate_Product_Instance__c estimateProductInstance)
ffscpq.AddEstimateProductService.AddEstimateProductsToEstimatesRequest
global with sharing class AddEstimateProductsToEstimatesRequest
The request structure for adding an estimate product to an estimate.
Properties
EstimateId |
Id |
The estimate to copy the estimate product to.
|
EstimateProductId |
Id |
The estimate product to be copied.
|
EstimateProductInstanceBillingType |
String |
[Optional] The billing type for the copied estimate product instance. Must be 'Fixed Price' or 'Time and Materials'. If this is not provided the estimate product's default billing type is used.
|
EstimateProductInstanceFixedPriceMargin |
Decimal |
[Optional] The fixed price margin for the copied estimate product instance. If the billing type is specified as 'Fixed Price', this parameter is mandatory. If the billing type is specified as 'Time and Materials' or is not provided, this parameter is not used.
|
Name |
String |
[Optional] The name for the copied estimate product instance. If this is not provided the estimate product's name is used.
|
StartDate |
Date |
[Optional] The start date of the copied estimate product instance will be offset relative to this date. If this is not provided the estimate's start date is used.
|
FinalizeEstimateAction |
ffscpq.AddEstimateProductService.IFinalizeEstimateAction |
[Optional] An action to be executed after all estimate products have been added to an estimate.
|
FinalizeAction |
ffscpq.AddEstimateProductService.IFinalizeEstimateProductAction |
[Optional] An action to be executed after the estimate product has been added to the estimate.
|
Methods
AddEstimateProductsToEstimatesRequest
global AddEstimateProductsToEstimatesRequest(Id estimateId, Id estimateProductId)
A default constructor with minimum required properties.
Input Parameters
estimateId |
Id |
The ID of the estimate. |
estimateProductId |
Id |
The ID of the estimate product. |
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 27 | Id estimateId = 'a6MDK000000L2fJ2AS' ;
Id estimateProductId = 'a6HDK000000L2uu2AC' ;
ffscpq.AddEstimateProductService.AddEstimateProductsToEstimatesRequest request = new ffscpq.AddEstimateProductService.AddEstimateProductsToEstimatesRequest(
estimateId,
estimateProductId
);
request.EstimateProductInstanceBillingType = 'Fixed Price' ;
request.EstimateProductInstanceFixedPriceMargin = 15 ;
request.Name = 'Delivery & Support' ;
request.StartDate = Date.newInstance( 2023 , 1 , 1 );
|
ffscpq.AddEstimateProductService.AddEstimateProductsToEstimatesResponse
global with sharing class AddEstimateProductsToEstimatesResponse
The result returned after adding an estimate product to an estimate.
Properties
EstimateProductId |
Id |
The estimate product that was added.
|
EstimateId |
Id |
The estimate which the estimate product was added to.
|
JobId |
Id |
The AsyncApexJob Id.
|
Errors |
List<ffscpq.AddEstimateProductService.AddEstimateProductError> |
A list containing errors that occurred while processing the request.
|
ffscpq.AddEstimateProductService.AddEstimateProductError
global with sharing class AddEstimateProductError
The error that occurred while processing the request.
Properties
Message |
String |
The error message.
|
|