Sample Flow to Activate a Contract on Approval

This page describes a sample flow to activate a contract automatically upon approval.

Warning:

This page does not give step-by-step instructions on how to create the sample 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.

The Sample Flow

This sample flow is a Record-Triggered Flow that uses the Activate Billing Contracts Apex action.

Diagram of Sample Flow to Activate A Contract on Approval

An explanation of each numbered item is provided in the table below.

# Flow Element Sample Flow Suggestion Sample Flow Setup
1 Flow Element: Start

Create a new Record-Triggered flow. In the Configure Start window, set:

Object: Billing Contract

Trigger the Flow When: A record is updated

Condition requirements: All conditions are met (AND)

Then add the following conditions:

ffbc__Status__c Equals Draft

ffbc__ApprovalStatus__c Equals Approved

When to Run the Flow for Updated Records: Every time a record is updated and meets the condition requirements

Screenshot of Configure Start window in the Flow UI
2 Flow Element: Apex Action Add an Action element. Choose the Activate Billing Contracts action, then complete the input values.

Set Input Values

Billing Contract ID to be activated: {!$Record.Id}
Generate Billing Schedules using a batch job that runs asynchronously: {!$GlobalConstant.True}

Warning:

See Custom Actions to Activate Contracts for more information about the "Generate Billing Schedules using a batch job that runs asynchronously" parameter and why you might need to set it to False.

Screenshot of New Action window in the Flow UI
3 Flow Element: End

End of flow.

 
  Activate the flow Remember to save and activate the flow to make it available for use.