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.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.

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.

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.

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.

isSuccess

global Boolean isSuccess()

Return Value

True if the operation was successful.

getContractId

global Id getContractId()

Return Value

ID of the resulting contract.

getErrors

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

Return Value

List of resulting errors.

ffbc.OrderToContractService.PrepareContractError

global with sharing class PrepareContractError

An error resulting from attempting to prepare a contract.

Methods

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.

PrepareContractError

global PrepareContractError(String message)

Construct an error with the given message.

Input Parameters

Name Type Description
message String Message for the error.

getPath

global String getPath()

Return Value

Path at which the error occurred.

getMessage

global String getMessage()

Return Value

Message for the error.

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.

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.

isSuccess

global Boolean isSuccess()

Return Value

True if a contract can be prepared.

getErrors

global List<String> getErrors()

Return Value

List of errors preventing a contract being prepared.

© Copyright 2009–2018 FinancialForce.com, inc. Confidential – all rights reserved. Various trademarks held by their respective owners.