Services CPQ API Developer Reference

ffscpq.EstimateCalculationService

global with sharing class EstimateCalculationService

A service that provides functionality related to calculating net amounts for estimate product instances.

Methods

getTotalForEachEstimateLineSet

global static List<ffscpq.EstimateCalculationService.CalculateEstimateLineSetResponse> getTotalForEachEstimateLineSet(List<ffscpq.EstimateCalculationService.CalculateEstimateLineSetRequest> requests)

A method that calculates the total net amount of a line set.

Input Parameters

Name Type Description
requests List<ffscpq.EstimateCalculationService.CalculateEstimateLineSetRequest> The list of CalculateEstimateLineSetRequests.

Return Value

This service returns CalculateEstimateLineSetResponse 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 lineset that you want to calculate the total for. A request is required for each lineset you want to calculate the total for.
Id lineSetId = 'a6321000000DmM0AaC';

// Construct the request
ffscpq.EstimateCalculationService.CalculateEstimateLineSetRequest request = new ffscpq.EstimateCalculationService.CalculateEstimateLineSetRequest(
    lineSetId
);

List<ffscpq.EstimateCalculationService.CalculateEstimateLineSetResponse> responses = ffscpq.EstimateCalculationService.getTotalForEachEstimateLineSet(
    new List<ffscpq.EstimateCalculationService.CalculateEstimateLineSetRequest>{ request }
);

// Extract the total
System.debug('Total for line set a6321000000DmM0AaC: ' + responses[0].SummedNetAmount);

getTotalForEachEstimateTask

global static List<ffscpq.EstimateCalculationService.CalculateEstimateTaskResponse> getTotalForEachEstimateTask(List<ffscpq.EstimateCalculationService.CalculateEstimateTaskRequest> requests)

A method that calculates the total net amount of a task.

Input Parameters

Name Type Description
requests List<ffscpq.EstimateCalculationService.CalculateEstimateTaskRequest> The list of CalculateEstimateTaskRequest.

Return Value

This service returns CalculateEstimateTaskResponse 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 task that you want to calculate the total of. A request is required for each task you want to calculate the total of.
Id taskId = 'a6321000000XmT0AaC';

// Construct the request
ffscpq.EstimateCalculationService.CalculateEstimateTaskRequest request = new ffscpq.EstimateCalculationService.CalculateEstimateTaskRequest(
    taskId
);

List<ffscpq.EstimateCalculationService.CalculateEstimateTaskResponse> responses = ffscpq.EstimateCalculationService.getTotalForEachEstimateTask(
    new List<ffscpq.EstimateCalculationService.CalculateEstimateTaskRequest>{ request }
);

// Extract the total
System.debug('Total for task a6321000000XmT0AaC: ' + responses[0].SummedNetAmount);

// Extract errors
System.debug('Number of errors: ' + responses[0].Errors.size());

getTotalForEachEstimateRoleRequest

global static List<ffscpq.EstimateCalculationService.CalculateEstimateRoleRequestResponse> getTotalForEachEstimateRoleRequest(List<ffscpq.EstimateCalculationService.CalculateEstimateRoleRequestRequest> requests)

A method that calculates the total net amount of a role request.

Input Parameters

Name Type Description
requests List<ffscpq.EstimateCalculationService.CalculateEstimateRoleRequestRequest> The list of CalculateEstimateRoleRequestRequest.

Return Value

This service returns CalculateEstimateRoleRequestResponse 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 role request that you want to calculate the total of. A request is required for each role request you want to calculate the total of.
Id roleRequestId = 'a6321000000XmT0AaC';

// Construct the request
ffscpq.EstimateCalculationService.CalculateEstimateRoleRequestRequest request = new ffscpq.EstimateCalculationService.CalculateEstimateRoleRequestRequest(
    roleRequestId
);

List<ffscpq.EstimateCalculationService.CalculateEstimateRoleRequestResponse> responses = ffscpq.EstimateCalculationService.getTotalForEachEstimateRoleRequest(
    new List<ffscpq.EstimateCalculationService.CalculateEstimateRoleRequestRequest>{ request }
);

// Extract the total
System.debug('Total for role request a6321000000XmT0AaC: ' + responses[0].SummedNetAmount);

// Extract errors
System.debug('Number of errors: ' + responses[0].Errors.size());

getTotalForEachEstimateProductInstance

global static List<ffscpq.EstimateCalculationService.CalculateEstimateProductResponse> getTotalForEachEstimateProductInstance(Set<Id> estimateIds)

A method that calculates the total net amount for each product estimate instance related to the given estimate Ids.

Input Parameters

Name Type Description
estimateIds Set<Id> The set of estimate Ids.

Return Value

This service returns CalculateEstimateProductResponse in a list that parallels the input list.

ffscpq.EstimateCalculationService.CalculateEstimateLineSetRequest

global with sharing class CalculateEstimateLineSetRequest

The request structure for calculating the net amount of a line set.

Properties

Name Type Description
LineSetId Id The ID of the estimate line set.

Methods

CalculateEstimateLineSetRequest

global CalculateEstimateLineSetRequest(Id lineSetId)

A default constructor with minimum required properties.

Input Parameters

Name Type Description
lineSetId Id The ID of the estimate line set.

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 line set that you want to calculate the total of. A request is required for each line set you want to calculate the total of.
Id lineSetId = 'a6321000000DmM0AaC';

// Construct the request
ffscpq.EstimateCalculationService.CalculateEstimateLineSetRequest request = new ffscpq.EstimateCalculationService.CalculateEstimateLineSetRequest(
    lineSetId
);

ffscpq.EstimateCalculationService.CalculateEstimateLineSetResponse

global with sharing class CalculateEstimateLineSetResponse

The result returned after calculating the net amount of a line set.

Properties

Name Type Description
LineSetId Id The ID of the estimate line set.
SummedNetAmount Decimal The sum of the net amounts of each role request contained in a line set.
Errors List<ffscpq.EstimateCalculationService.EstimateCalculationError>

ffscpq.EstimateCalculationService.CalculateEstimateTaskRequest

global with sharing class CalculateEstimateTaskRequest

The request structure for calculating the net amount of a task.

Properties

Name Type Description
TaskId Id The ID of the estimate task.

Methods

CalculateEstimateTaskRequest

global CalculateEstimateTaskRequest(Id taskId)

A default constructor with minimum required properties.

Input Parameters

Name Type Description
taskId Id The ID of the estimate task.

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 task that you want to calculate the total of. A request is required for each task you want to calculate the total of.
Id taskId = 'a6321000000XmT0AaC';

// Construct the request
ffscpq.EstimateCalculationService.CalculateEstimateTaskRequest request = new ffscpq.EstimateCalculationService.CalculateEstimateTaskRequest(
    taskId
);

ffscpq.EstimateCalculationService.CalculateEstimateTaskResponse

global with sharing class CalculateEstimateTaskResponse

The result returned after calculating the net amount of a task.

Properties

Name Type Description
TaskId Id The ID of the estimate task.
SummedNetAmount Decimal The sum of the net amounts of a task.
Errors List<ffscpq.EstimateCalculationService.EstimateCalculationError> The list containing errors that occured while processing the request.

ffscpq.EstimateCalculationService.CalculateEstimateRoleRequestRequest

global with sharing class CalculateEstimateRoleRequestRequest

The request structure for calculating the net amount of a role request.

Properties

Name Type Description
RoleRequestId Id The ID of the estimate role role request.

Methods

CalculateEstimateRoleRequestRequest

global CalculateEstimateRoleRequestRequest(Id roleRequestId)

A default constructor with minimum required properties.

Input Parameters

Name Type Description
roleRequestId Id The ID of the estimate task.

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 role request that you want to calculate the total of. A request is required for each role request you want to calculate the total of.
Id roleRequestId = 'a6321000000XmT0AaC';

// Construct the request
ffscpq.EstimateCalculationService.CalculateEstimateRoleRequestRequest request = new ffscpq.EstimateCalculationService.CalculateEstimateRoleRequestRequest(
    roleRequestId
);

ffscpq.EstimateCalculationService.CalculateEstimateRoleRequestResponse

global with sharing class CalculateEstimateRoleRequestResponse

The result returned after calculating the net amount of a role request.

Properties

Name Type Description
RoleRequestId Id The ID of the estimate role role request.
SummedNetAmount Decimal The sum of the net amounts of a role request.
Errors List<ffscpq.EstimateCalculationService.EstimateCalculationError> The list containing errors that occured while processing the request.

ffscpq.EstimateCalculationService.CalculateEstimateProductResponse

global with sharing class CalculateEstimateProductResponse

The result returned after calculating the net amount for an estimate product instance.

Properties

Name Type Description
EstimateId Id The estimate Id.
EstimateProductInstanceId Id The estimate product instance Id.
SummedNetAmount Decimal The sum of net amounts of role requests and vendor line items for an estimate product instance. The value is in the currency of the estimate.
BillableExpenseAmount Decimal The sum of net amounts of billable expenses for an estimate product instance. The value is in the currency of the estimate.
VendorLineItemBillAmount Decimal The sum of bill amounts of vendor line items for an estimate product instance. The value is in the currency of the estimate.

ffscpq.EstimateCalculationService.EstimateCalculationError

global with sharing class EstimateCalculationError

The error that occured while processing a request.

Properties

Name Type Description
Message String The error message.
© Copyright 2009–2024 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.