ffscpq.AddFromEstimateTemplateServiceglobal with sharing class AddFromEstimateTemplateService A service that provides functionality related to copying all related records from one estimate to another. MethodsaddAllRelatedRecordsglobal static List<ffscpq.AddFromEstimateTemplateService.AddAllRelatedRecordsResponse> addAllRelatedRecords(List<ffscpq.AddFromEstimateTemplateService.AddAllRelatedRecordsRequest> requests) A method that copies all related records from an estimate. Input Parameters
Return ValueThis service returns AddAllRelatedRecordsResponse in a list that parallels the input list. 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. // The ID of the estimate that you want to copy records from. Id sourceEstimateId = 'a6CF20000007Z1ZeAQ'; // The ID of the estimate that you want to copy records to. Id destinationEstimateId = 'a6C320000007Z1eEaA'; // Construct the request ffscpq.AddFromEstimateTemplateService.AddAllRelatedRecordsRequest request = new ffscpq.AddFromEstimateTemplateService.AddAllRelatedRecordsRequest( sourceEstimateId, destinationEstimateId ); // You can optionally set this to false if you dont want to copy skills. request.IncludeSkills = false; // You can optionally set the StartDate if you dont want to offset the start date of copied records relative to target estimate start date. request.StartDate = Date.newInstance(2023, 1, 1); // You can optionally set the EndDate if you dont want to offset the end date of copied records relative to template estimate end date. request.EndDate = Date.newInstance(2023, 2, 1); List<ffscpq.AddFromEstimateTemplateService.AddAllRelatedRecordsResponse> responses = ffscpq.AddFromEstimateTemplateService.addAllRelatedRecords( new List<ffscpq.AddFromEstimateTemplateService.AddAllRelatedRecordsRequest>{ request } ); // Extract the jobId System.debug( 'The jobId for copying all related records from source estimate ' + responses[0].SourceEstimateId + ' to destination estimate ' + responses[0].DestinationEstimateId + ': ' + responses[0].JobId ); // Extract errors System.debug('Number of errors: ' + responses[0].Errors.size()); ffscpq.AddFromEstimateTemplateService.AddAllRelatedRecordsRequestglobal with sharing class AddAllRelatedRecordsRequest The request structure for copying all related records from an estimate. Properties
MethodsAddAllRelatedRecordsRequestglobal AddAllRelatedRecordsRequest(Id sourceEstimateId, Id destinationEstimateId) A default constructor with minimum required properties. Input Parameters
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. // The ID of the estimate that you want to copy records from. Id sourceEstimateId = 'a6CF20000007Z1ZeAQ'; // The ID of the estimate that you want to copy records to. Id destinationEstimateId = 'a6C320000007Z1eEaA'; // Construct the request ffscpq.AddFromEstimateTemplateService.AddAllRelatedRecordsRequest request = new ffscpq.AddFromEstimateTemplateService.AddAllRelatedRecordsRequest( sourceEstimateId, destinationEstimateId ); // You can optionally set this to false if you dont want to copy skills. request.IncludeSkills = false; // You can optionally set the StartDate if you dont want to offset the start date of copied records relative to target estimate start date. request.StartDate = Date.newInstance(2023, 1, 1); // You can optionally set the EndDate if you dont want to offset the end date of copied records relative to template estimate end date. request.EndDate = Date.newInstance(2023, 2, 1); ffscpq.AddFromEstimateTemplateService.AddAllRelatedRecordsResponseglobal with sharing class AddAllRelatedRecordsResponse The result returned after copying all related record from an estimate. Properties
ffscpq.AddFromEstimateTemplateService.AddFromEstimateTemplateErrorglobal with sharing class AddFromEstimateTemplateError The error that occurred while processing the request. Properties
|