Billing Central Apex API Developer Reference

ffbc.ContractsAmendmentService

global with sharing class ContractsAmendmentService

This class provides services for automated amendments to active contracts.

Methods

changeContractPricesByPercentage

global static ffbc.ContractsAmendmentService.ChangeContractPricesByPercentageResponse changeContractPricesByPercentage(ffbc.ContractsAmendmentService.ChangeContractPricesByPercentageRequest request)

Create change requests that will increase the unit prices on the given contracts by a fixed percentage value, taking effect on the date given. This service will only create the change requests, they must be applied separately using ContractsService.applyChangeRequests.
This cannot be used for contracts that contain lines using pricing structures. An exception will be thrown if any pricing structures are found.
If this API is used on a contract that has been renewed, a change request will be created and the response will contain a warning as a reminder to correct the prices on the renewal.

Exceptions Thrown

Value Description
BillingCentralException An exception is thrown if there is an error creating or saving any of the change requests.
DmlException An exception is thrown if there is an unexpected error saving the change requests.

Return Value

Response containing the IDs of the change requests that have been created.

changeContractLinePrices

global static ffbc.ContractsAmendmentService.ChangeContractLinePricesResponse changeContractLinePrices(List<ffbc.ContractsAmendmentService.ChangeContractLinePricesRequest> requests)

Create change requests that will change the unit prices on the given contracts by given amounts for each line, taking effect on the date given. This service will only create the change requests, they must be applied separately using ContractsService.applyChangeRequests.
This cannot be used to amend prices on lines using pricing structures. An exception will be thrown if any pricing structures are found.
If this API is used on a contract that has been renewed, a change request will be created and the response will contain a warning as a reminder to correct the prices on the renewal.

Exceptions Thrown

Value Description
BillingCentralException An exception is thrown if there is an error creating or saving any of the change requests.
DmlException An exception is thrown if there is an unexpected error saving the change requests.

Return Value

Response containing the IDs of the change requests that have been created.

ffbc.ContractsAmendmentService.ChangeContractPricesByPercentageRequest

global with sharing class ChangeContractPricesByPercentageRequest

A request to amend contract prices by a certain percentage, used with changeContractPricesByPercentage.

Properties

Name Type Description
ContractIds Set<Id> The IDs of the contracts to have their prices amended. These must be active contracts.
Percentage Decimal The percentage by which to adjust the prices, with 100 being a 100% increase. A positive value will increase the prices, a negative value will decrease the prices.
EffectiveFromDate Date The date on which the new prices will take effect.

Methods

ChangeContractPricesByPercentageRequest

global ChangeContractPricesByPercentageRequest()

Creates a request with an empty set of contract IDs, a percentage change of 0, and an effective from date of tomorrow.

ChangeContractPricesByPercentageRequest

global ChangeContractPricesByPercentageRequest(Set<Id> contractIds, Decimal percentage, Date effectiveFromDate)

Creates a request with the given contract IDs, percentage change, and effective from date.

ffbc.ContractsAmendmentService.ChangeContractPricesResponse

global virtual with sharing class ChangeContractPricesResponse extends Response

The result of amending contract prices using changeContractPricesByPercentage or changeContractLinePrices. This class contains the data that is common to both the line and percentage amendment variants. The two variants then extend this class to provide their own responses. This class currently will never report any errors. Errors in creating a change request for any contract will produce an exception. This response may contain warnings.

This class extends ffbc.Response

Properties

Name Type Description
ChangeRequestIdsByActiveContractId Map<Id, Id> The IDs of the change requests created, keyed by active contract ID.

Methods

ChangeContractPricesResponse

global ChangeContractPricesResponse()

Creates a response with no change request IDs.

ChangeContractPricesResponse

global ChangeContractPricesResponse(Map<Id, Id> changeRequestIdsByActiveContractId)

Creates a response with the given change request IDs keyed by active contract ID.

ffbc.ContractsAmendmentService.ChangeContractPricesByPercentageResponse

global with sharing class ChangeContractPricesByPercentageResponse extends ChangeContractPricesResponse

The result of amending contract prices using changeContractPricesByPercentage. This class currently will never report any errors. Errors in creating a change request for any contract will produce an exception. This response may contain warnings.

This class extends ffbc.ContractsAmendmentService.ChangeContractPricesResponse

Methods

ChangeContractPricesByPercentageResponse

global ChangeContractPricesByPercentageResponse()

Creates a response with no change request IDs.

ChangeContractPricesByPercentageResponse

global ChangeContractPricesByPercentageResponse(Map<Id, Id> changeRequestIdsByActiveContractId)

Creates a response with the given change request IDs keyed by active contract ID.

ffbc.ContractsAmendmentService.ChangeContractLinePricesRequest

global with sharing class ChangeContractLinePricesRequest

A request to amend prices for a contract by given amounts for each line, used with changeContractLinePrices.

Properties

Name Type Description
ContractId Id The ID of the contract to have its prices amended. This must be an active contract.
linePrices Map<Id, ffbc.ContractsAmendmentService.ContractLinePriceInfo> A Map of line/price info objects where each object contains pricing information for the contract line item whose ID provides the key.

Methods

ChangeContractLinePricesRequest

global ChangeContractLinePricesRequest()

Creates an empty request

ChangeContractLinePricesRequest

global ChangeContractLinePricesRequest(Id contractId, Map<Id, ffbc.ContractsAmendmentService.ContractLinePriceInfo> linePrices)

Creates a request with the given contract ID and line amendments.

ffbc.ContractsAmendmentService.ContractLinePriceInfo

global with sharing class ContractLinePriceInfo

Contains new price information for a contract line item. Includes the new unit price and effective from date. Used with ChangeContractLinePricesRequest.

Properties

Name Type Description
UnitPrice Decimal The new unit price for the line.
EffectiveFromDate Date The date on which the new price will take effect.

Methods

ContractLinePriceInfo

global ContractLinePriceInfo()

Creates an empty object

ContractLinePriceInfo

global ContractLinePriceInfo(Decimal unitPrice, Date effectiveFromDate)

Creates an object with the given line unit price and effective from date

ffbc.ContractsAmendmentService.ChangeContractLinePricesResponse

global with sharing class ChangeContractLinePricesResponse extends ChangeContractPricesResponse

The result of amending contract prices using changeContractLinePrices. This class currently will never report any errors. Errors in creating a change request for any contract will produce an exception. This response may contain warnings.

This class extends ffbc.ContractsAmendmentService.ChangeContractPricesResponse

Methods

ChangeContractLinePricesResponse

global ChangeContractLinePricesResponse()

Creates a response with no change request IDs.

ChangeContractLinePricesResponse

global ChangeContractLinePricesResponse(Map<Id, Id> changeRequestIdsByActiveContractId)

Creates a response with the given change request IDs keyed by active contract ID.

© Copyright 2009–2022 FinancialForce.com, inc. All rights reserved. Various trademarks held by their respective owners.