Custom Action to Create Change Requests

You can implement customizations to create change requests. You can do this programmatically via the API, or you can do it without writing code by invoking the following Apex action from a Salesforce flow:

Category

Apex Action Apex Class Purpose
Billing Contract Create Change Requests ContractsServiceActionCreateCR

Takes the ID of an active contract that you want to create a change request for.

You could use this action to enable users to add service credits to an active contract. For example:

  • You could design a screen flow that uses a button on the billing contract header to open a screen where the user enters contract line information such as product, value, start and end dates, and description. On saving the information, Billing Central creates a change request for the active contract, then the flow adds a new contract line on the change request using the information provided by the user.

  • You could design a record-triggered flow that uses two custom fields on the billing contract header: a custom field to hold the credit value and a custom checkbox to flag that the credit value should be applied. Including these two fields in the billing contract list view allows the user to easily enter credit values on multiple contracts, and by selecting the "apply" checkbox on multiple contracts and saving the changes in the list view a record-triggered flow is triggered to create change requests for all the updated contracts.

In both these scenarios, you can include the Apply Change Requests Apex action in the flow to automatically apply the change request.

For more information, see "Sample Flow to Create Change Requests" below.

Input Parameters

The Create Change Requests Apex action has the following input parameter for each contract passed to it.

Parameter

Required or Optional

Description

Contract ID Required ID of the active contract to create a change request for.

Output Values

Errors from the Create Change Requests Apex action are not recorded in logs. If you want to capture errors and notify the user (for example, by email or Salesforce task) you can store the return values in resources which are available to other flow elements. For an illustration of how to do this, see Custom Action to Create Change Requests.

When configuring the action in a flow, click Advanced and select the Manually Assign Variables checkbox to store the following return values.

Output Variable

Description

Active Contract ID ID of the active contract that a change request was created for.
ID of newly created change request ID of the change request that the action created for the given contract.
Error while creating this change request

Assign this to a text variable which can be used to store the error message so that an Action element can email it to the user. If multiple errors occur when attempting to create a change request for an active contract, this parameter stores all the error messages joined into one.

Has Errors Assign this to a boolean variable to store the outcome of the action, so it can be used by a Decision element later in the flow.

Permissions

To configure a Salesforce flow to use this Apex action, you must be assigned a permission set that includes access to the corresponding Apex class. The class is included in the following packaged permission set:

  • Billing Central API

For more information about creating Salesforce flows, see the Salesforce Help.

Sample Flows to Create Change Requests

For illustrations of how flows can be configured to use this Apex action, see Sample Flow to Apply Service Credit via a Screen Flow and Sample Flow to Apply Service Credit via a Record-Triggered Flow.

Note:

The sample flow descriptions do not give step-by-step instructions on how to create the flow. The information is intended for administrators who are already experienced at creating Salesforce flows. Refer to the Salesforce Help if you need information about how to create flows.

Volume Information

When using this action in a screen flow to create a change request with a service credit line, we have found that Billing Central (when not using any customizations) can process a contract with 700 lines.

When using this action in a record-triggered flow to create change requests with a service credit line via custom fields in the billing contract list view, we have found that Billing Central (when not using any customizations) can process 200 contracts with 5 lines each. If your contracts typically have more than 5 lines, the likelihood of Billing Central processing 200 contracts at once is reduced.

The exact number of contracts that Billing Central can handle will vary depending on other steps within the flow, whether any customizations are implemented in your org, the size and complexity of your contracts, and platform limits.