Billing Central Apex API Developer Reference

ffbc.IntegrationSetupService

global with sharing class IntegrationSetupService

This class provides service functionality for the configuration of integrations to Salesforce standard objects. Currently this supports an integration of the Salesforce CPQ Order to Billing Central Contract.

Enums

ContractAction

An enum representing the standard types of order that can be used to create Contracts.

Value Description
NewContract Create a new contract.
RenewContract Renew an existing contract.
UpsellContract Upsell an existing contract.
ReplaceContract Replace an existing contract.
NoAction Do not perform any action.

Methods

applyCPQ

global static ffbc.IntegrationSetupService.ApplyAsyncState applyCPQ(ffbc.IntegrationSetupService.ApplyAsyncState applyState, ffbc.IntegrationSetupService.CPQConfiguration configuration)

Enable Salesforce CPQ integration by applying the passed configuration. This method should be called repeatedly from separate execution contexts which have not performed any DML operations until it returns null. On the first invocation pass null as applyState and subsequent calls pass the return value from the last call. You may inspect the state for error and progress messages. Once an error has been indicated subsequent calls of applyCPQ will not perform any operations.

Input Parameters

Name Type Description
applyState ffbc.IntegrationSetupService.ApplyAsyncState Asynchronous call state, pass null to first invocation.

Return Value

Asynchronous call state, will return null when complete.

initCPQ

global static ffbc.IntegrationSetupService.InitAsyncState initCPQ(ffbc.IntegrationSetupService.InitAsyncState initState)

Initialise CPQ integration by performing required configuration actions. This method should be called repeatedly from separate execution contexts which have not performed any DML operations until it returns null. On the first invocation pass null as initState and subsequent calls pass the return value from the last call. You may inspect the state for error and progress messages. Once an error has been indicated subsequent calls of initCPQ will not perform any operations.

Input Parameters

Name Type Description
initState ffbc.IntegrationSetupService.InitAsyncState Asynchronous call state, pass null to first invocation.

Return Value

Asynchronous call state, will return null when complete.

loadCPQ

global static ffbc.IntegrationSetupService.CPQConfiguration loadCPQ()

Load the current Salesforce CPQ configuration integration information. Integration initialisation must have been completed via initCPQ() before calling this.

Return Value

The integration configuration.

getPicklistValues

global static List<Schema.PicklistEntry> getPicklistValues(String contextObject, String expression)

Get picklist values for a field identified via an expression

Input Parameters

Name Type Description
contextObject String Name of sObject the expression should be evaluated against.
expression String The expression that identifies a field.

Return Value

List of picklist values or empty list if expression does not identify a picklist field.

validateSourceExpression

global static List<String> validateSourceExpression(String contextObject, String expression)

Validate that an expression uniquely identifies a single field.

Input Parameters

Name Type Description
contextObject String Name of sObject the expression should be evaluated against.
expression String The expression to validate.

Return Value

List of errors relating to the expression, an empty list if valid or null if contextObject does not exist.

ffbc.IntegrationSetupService.ApplyAsyncState

global with sharing class ApplyAsyncState

Base class for state passed into a returned from applyCPQ function.

Properties

Name Type Description
Errors List<String> Error message from the function.

Methods

ApplyAsyncState

global ApplyAsyncState()

ffbc.IntegrationSetupService.ContractActionInfo

global with sharing class ContractActionInfo

A container for additional information on a ContractAction

Properties

Name Type Description
Action ffbc.IntegrationSetupService.ContractAction The ContractAction that matches the label.
Label String The label for the ContractAction, conditional to go with 'If...'.
FactiveLabel String Factive label for the ContractAction, to go with 'When...'.
OpportunityTypeValue String The OpportunityType field value on Order that has this action as a default

Methods

ContractActionInfo

global ContractActionInfo()

ContractActionInfo

global ContractActionInfo(ffbc.IntegrationSetupService.ContractAction action, String label, String factiveLabel, String opportunityTypeValue)

ffbc.IntegrationSetupService.CPQConfiguration

global with sharing class CPQConfiguration

This class contains integration configuration information. You can read this information using loadCPQ. To make changes use applyCPQ with updated OrderActions, HeaderMappings and LineItemMappings; other fields are ignored by applyCPQ.

Properties

Name Type Description
ErrorMessages List<String> Contains list of errors found during configuration loading
ContractActionTypes List<ffbc.IntegrationSetupService.ContractActionInfo> List of supported contract actions with related information
OrderActions List<ffbc.IntegrationSetupService.OrderAction> List of active order actions that determines what happens and when
HeaderMappings List<ffbc.IntegrationSetupService.FieldMapping> List of header field mappings
LineItemMappings List<ffbc.IntegrationSetupService.FieldMapping> List of line item field mappings
ContractFields List<ffbc.IntegrationSetupService.FieldName> List of available Contract header fields
ContractLineItemFields List<ffbc.IntegrationSetupService.FieldName> List of available Contract line item fields
OrderFields List<ffbc.IntegrationSetupService.FieldName> List of available Order header fields
OrderLineItemFields List<ffbc.IntegrationSetupService.FieldName> List of available Order line item fields
TriggerFieldPicklistEntries List<Schema.PicklistEntry> Picklist entries for HeaderMapping trigger field, empty if not a picklist

Methods

CPQConfiguration

global CPQConfiguration()

ffbc.IntegrationSetupService.FieldMapping

global with sharing class FieldMapping

Detail of a mapping between Order and Contract fields. The same structure is used to store both 'header' and 'lines' mappings. For lines the mapping is assumed between OrderItem and ContractLineItem sObjects.

Properties

Name Type Description
OrderDisplayExpression String A short string that may be used as an alternative to displaying the full expression.
OrderExpression String An expression identifying a field accessible from the Order or OrderItem sObjects.
ContractFieldName String The name of a field on the Contract or ContractLineItem objects.
ContractFieldLabel String The label of the ContractFieldName field.
IsCustom Boolean Is this a custom mapping, these are additional mappings not shipped in Certinia products
IsTrigger Boolean Is this the mapping used to determine what type of Contract is created

Methods

FieldMapping

global FieldMapping()

ffbc.IntegrationSetupService.FieldName

global with sharing class FieldName implements Comparable

Wrapper for a field APIName with its Label.

Properties

Name Type Description
Label String The label of the field.
APIName String The API name of the field.
isTriggerable Boolean Set true for Order fields that can be used as the trigger fields

Methods

FieldName

global FieldName()

FieldName

global FieldName(Schema.SObjectType objectType, Schema.SObjectField field)

ffbc.IntegrationSetupService.InitAsyncState

global with sharing class InitAsyncState

Class for state passed into and returned from initCPQ function.

Properties

Name Type Description
Errors List<String> Error message from the function.
ProgressMessages List<String> Progress messages from the function.
HelpURL String Location of help topic
CPQVersion Integer The major version of Salesforce CPQ if installed, null otherwise.
CPQMinimumVersion Integer The minimum major version of Salesforce CPQ supported.
OpportunityToContractIntegrationEnabled Boolean Flag indicating if Opportunity to Contract is enabled in Feature Console.
OrderToContractIntegrationEnabled Boolean Flag indicating if Order to Contract is enabled in Feature Console.

Methods

InitAsyncState

global InitAsyncState()

ffbc.IntegrationSetupService.OrderAction

global with sharing class OrderAction

Holds the contract action to be performed for a given value of the Order trigger field.

Properties

Name Type Description
OrderTriggerValue String The value on the Order trigger field that the action should be applied for.
ContractAction ffbc.IntegrationSetupService.ContractAction What action to perform.

Methods

OrderAction

global OrderAction()

OrderAction

global OrderAction(String orderTriggerValue, ffbc.IntegrationSetupService.ContractAction contractAction)

© Copyright 2009–2024 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.