Billing Central Apex API Developer Reference

ffbc.OrderToContractService

global with sharing class OrderToContractService

Service class that provides functionality for the Order to Contract integration.

Methods

canPrepareContracts

global static List<ffbc.OrderToContractService.CanPrepareContractResult> canPrepareContracts(List<Id> orderIds)

Check the specified orders are valid for contracts to be prepared, and that the org is correctly setup.

Input Parameters

Name Type Description
orderIds List<Id> IDs of the orders to prepare contracts from.

Return Value

List of CanPrepareContractResults containing the success state and any errors.

prepareContracts

global static List<ffbc.OrderToContractService.PrepareContractResult> prepareContracts(List<Id> orderIds)

Prepare contracts from the given order IDs.

Input Parameters

Name Type Description
orderIds List<Id> IDs of the orders to prepare contracts from.

Return Value

List of PrepareContractResults containing the success state and any errors.

ffbc.OrderToContractService.CanPrepareContractResult

global with sharing class CanPrepareContractResult

Result of checking if a contract can be prepared from a single Order ID.

Methods

CanPrepareContractResult

global CanPrepareContractResult()

Construct a successful result with no errors.

getErrors

global List<String> getErrors()

Return Value

List of errors preventing a contract being prepared.

isSuccess

global Boolean isSuccess()

Return Value

True if a contract can be prepared.

withError

global ffbc.OrderToContractService.CanPrepareContractResult withError(String error)

Add the specified error to the result, and mark it as failed.

Input Parameters

Name Type Description
error String Error to be added to the result.

Return Value

Result instance to allow chaining methods.

ffbc.OrderToContractService.PrepareContractResult

global with sharing class PrepareContractResult

Result of preparing a contract from a single order ID.

Methods

PrepareContractResult

global PrepareContractResult()

Construct a successful result with no errors.

getContractId

global Id getContractId()

Return Value

ID of the resulting contract.

getErrors

global List<ffbc.OrderToContractService.PrepareContractError> getErrors()

Return Value

List of resulting errors.

isSuccess

global Boolean isSuccess()

Return Value

True if the operation was successful.

withContractId

global ffbc.OrderToContractService.PrepareContractResult withContractId(Id contractId)

Specify the ID of the resulting contract.

Input Parameters

Name Type Description
contractId Id ID of the resulting contract.

Return Value

Result instance to allow chaining methods.

withError

global ffbc.OrderToContractService.PrepareContractResult withError(ffbc.OrderToContractService.PrepareContractError error)

Add the specified PrepareContractError object to the result.

Input Parameters

Name Type Description
error ffbc.OrderToContractService.PrepareContractError Error to be added to the result.

Return Value

Result instance to allow chaining methods.

withError

global ffbc.OrderToContractService.PrepareContractResult withError(String message)

Add the specified error message text to the result.

Input Parameters

Name Type Description
message String Error message to be added to the result.

Return Value

Result instance to allow chaining methods.

ffbc.OrderToContractService.PrepareContractError

global with sharing class PrepareContractError

An error resulting from attempting to prepare a contract.

Methods

PrepareContractError

global PrepareContractError(String message)

Construct an error with the given message.

Input Parameters

Name Type Description
message String Message for the error.

PrepareContractError

global PrepareContractError(String path, String message)

Construct an error with the given path and message.

Input Parameters

Name Type Description
path String Path at which the error occurred.
message String Message for the error.

getMessage

global String getMessage()

Return Value

Message for the error.

getPath

global String getPath()

Return Value

Path at which the error occurred.

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