Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Explore Screen Flows and Page Components

Learning Objectives

After completing this unit, you’ll be able to:

  • Make the key decisions that help you design a screen flow.
  • Design a screen flow to apply rebate types to Contract.
  • Add the Rebate panel and tab components to standard object page layouts.

Show Me the Incentives

Cindy can use a no-code tool like Salesforce Flow and craft a business process that runs when eligible rebates are selected. When Vance selects the eligible rebates on a contract, the selection triggers the screen flow that Cindy created. Cindy can even trigger APIs to extend the screen flow logic for more complex scenarios. For now, Cindy chose to create her flow in the Flow Builder itself.

Here are some requirements that Cindy kept in mind when she designed the screen flow.

  • The screen flow needs to process the multiple selected rebate types from the Eligible tab of the Program Rebate Types Panel card.
  • On clicking Add Program Rebate Types, the user should be prompted to create a new rebate program. They need to be asked to fill in the name and payout frequency of the program, and then confirm it.
  • A new rebate program gets created with the contract’s account as a member, and the selected rebate types with all their attributes.
  • Optionally, Cindy can ensure that as soon as the contract is active, the associated new rebate program is also active.

What’s in a Flow?

Note

In this module, we won’t go through the exact steps of how to configure the screen flow. You can download sample screen flows in your org using this link and tweak these as per your requirements. In this badge, our examples are in a flow set to Free-Form.

Cindy needed to design a screen flow as per the business requirements. But there were a few decisions that she had to make, irrespective of the specific elements she added to the flow.

  1. Define two input variables.
    • Here’s how she defined the variable to store the eligible rebate types:
      • Data Type: Record
      • Object: Program Rebate Type
      • Availability Outside the Flow: Available for input
      • Select the check box Allow multiple values (collection)
        Create a collection variable to store eligible rebate types.
    • Here’s how she defined the variable to store the eligible contract record:
      • Data Type: Record
      • Object: Contract
      • Availability Outside the Flow: Available for input
      • Deselect the check box Allow multiple values (collection)
        Create a single record variable to store the target object record.
  1. Decide how to create a rebate program and apply the rebate types.
    • Create a rebate program.
      • A contract’s account can be added to the existing rebate program with the selected rebate types. If the benefits are the same across members, this is the best option.
      • A contract’s account can be added to a new rebate program that deep clones all the attributes of the selected rebate types. If the benefits vary by account and are negotiated for each account, this is the best option.
    • Associate rebate types to the program.
      • Apply the selected rebate types directly to the contract by creating a reference record as explained in the next step.
      • Clone the selected rebate types and apply those to the contract: If you want to create a new program, clone the rebate types and the associated objects. Then, add the newly cloned rebate types to the cloned program.
        Add a subflow to create a new rebate program and add the selected rebate types to it.
  1. Create a Program Rebate Type Reference record to store the rebate types, and the contract reference. Provide the following inputs.
    • Reference Object is the current object, Contract.
    • Program Rebate Type is the selected or cloned Rebate Type ID.
    • Program Rebate Type Source is the selected integrable rebate type ID from the standard rebate program that was cloned.
      Create a record to store the Program Rebate Type Reference records.
  1. Add the contract's account as an active member of the rebate program.
  2. Optionally, populate the Rebate Program on the contract record. Cindy has already created a custom field on Contract for the Rebate Program lookup. This helps maintain an association of the contract to its rebate program.
    Create an Update record element to populate the rebate program on the target record.
  3. Optionally, manage the approval of the Rebate Program in conjunction with the contract.

Here are the components that Cindy added to the screen flow for Contracts. While some are mandatory, the others are use-case-specific. Admins can also add validations to a screen flow so that the user can view failure and success messages when they add the selected rebate types to a reference record.

A sample screen flow with elements that help add eligible rebate types to a contract and create a new program with rebate types.

Component

Resource Type

Mandatory?

Purpose

Get Records for Contract

Get Record Element

Yes

Choose the following fields for Contract and store the values together in a record variable:

  • ID
  • Contract Number
  • Account ID
  • Created Date

Get Records for Member

Get Record Element

Yes

Choose the following fields for Member and automatically store all fields. Filter records by the following:

  • Rebate Program ID
  • Account ID

Get Selected Rebate Types

Get Record Element

Yes

Filter records by the ID of the rebate type. The IDs can be retrieved with a Loop element that uses a record collection variable {!SelectedRebateTypes}.

Create Record for Member

Create Record Element

No

If the screen flow allows you to create a new rebate program, use this element to extract the account ID and rebate program ID and create a new member record.

Create Record for Rebate Type

Create Record Element

No

If the screen flow allows you to create a rebate program, use this element to clone the selected eligible rebate types and create ones.

Create Reference Record

Create Record Element

Yes

Create the Program Rebate Type Reference records with the following inputs:

  • Reference Object is the current object, Contract.
  • Program Rebate Type is the selected or cloned rebate type ID.
  • Program Rebate Type Source is the selected integrable rebate type ID.

Add Selected Rebate Types

Screen Element

Yes

This screen flow defines how the confirmation popup looks and what the user confirms when they add eligible rebate types to the selected record.

Get Rebate Program

Screen Element

No

If the use case allows the user to define attributes of the new program or to clone an existing program, this element defines how that screen would look like.

Is the Rebate Program Populated?

Decision Element

No

If the user selects an existing rebate program, this decision would pass that value.

Get a Program from User Selection

Decision Element

No

If the user creates a rebate program, this decision would pass the attribute values.

Does a Member Exist?

Decision Element

Yes

If the account of the contract is already enrolled in a rebate program, this decision passes that information to the Applied tab of the Program Rebate Types Panel card.

Set Rebate Program

Assignment Element

No

For any of the decision elements, this assignment helps associate the reference contract record to an existing or cloned rebate program.

Create Program

Subflow

Yes

Depending on whether an existing rebate program is cloned or a new one gets created, this subflow creates a program record with all necessary attributes.

Create Benefits and Filters

Subflow

No

When the selected rebate types are added to a rebate program, the associated benefits and eligibility criteria also get cloned.

Cindy checked off the second requirement on the list of configurations. She also created a similar flow for Orders, using a different logic as required. 

All that was left to do was to add the components to the Contract and Order page layouts that allow the users to view and apply the incentives.

Drag and Drop Components

Let’s see how Cindy added the two components to the Contract and Order page layouts.

  1. Open the details page for an eligible object record. Cindy opened the contract record for Meridian Partners.
  2. Click Setup, and select Edit Page.
  3. Drag the Program Rebate Types Panel component to where you want the component to appear on the page.
  4. Select a value in the Flow field. Cindy selected Rebates for Contracts.
  5. Select a value in the Eligible Program Rebate Types Variable. This variable must be a record collection variable of the Program Rebate Type object that she’d defined in the screen flow. Cindy selected SelectedRebateTypes.
  6. Select a value for the Record Variable. This variable must be a record variable of the eligible object that she’d defined in the screen flow. Cindy selected CurrentRecord.
  7. Drag the Program Rebate Types Tab component to where you want the component to appear on the page.
  8. Save your work, and click Activation.
    The two Lightning components for Rebate Types in the Lightning App Builder.
  9. Assign it as the org default.
  10. Repeat steps 1–9 for Order page layout with the following details:

    Object Page Layout

    Flow

    Eligible Program Rebate Types Variable

    Record Variable

    Order

    Rebates on Orders

    SelectedRebateTypes

    CurrentRecord

And that’s how Cindy completed the last of the three configurations. 

To Recap

You’ve come a long way. You started by looking at the business challenges Rayler Parts faced due to a disconnected sales process.

You then hit the fast-forward button and checked out how program managers, account managers, and operations managers benefitted from having incentives seamlessly unified within the sales process. You saw how they tailored the incentive terms right in the context of a contract. While placing orders, rebate information was present for analysis, and partners were able to get clear visibility into how they can gain higher benefits and better payouts.

Finally, you pressed rewind to explore the configurations that went into the making of this process. You saw how Cindy created this experience to enhance the sales process. And now, you’re done! 

Now that you’ve followed Cindy, Vance, and Rishi on their journey, you’re ready to blaze your own trail with Rebate Management.

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback