Skip to main content

Set Up Rebate Management and Associated Features

Learning Objectives

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

  • List Salesforce Flow templates.
  • List data processing engine (DPE) definitions.
  • Explain batch management.
  • Explain how the approval process works for Rebate Management.

Say Hello to Templates

In the previous unit, you learned that Rebate Management comes with predefined templates for Salesforce Flows, Data Processing Engine, and Batch Management. Let’s find out more about them.

Data Processing Engine (DPE): A Data Processing Engine extracts data from standard and custom objects in your org and transforms it based on your business requirements. You can create or update specific object records with the transformed data. Predefined data processing engine definitions are available for you to query, filter, and aggregate data for different rebate calculations and journal transactions. 

The Data Processing Engine page showing details of the Aggregate by Member definition

Batch Management: Thousands of rebate payout records could be waiting for processing in your org at any given point in time. With Batch Management, you can split the records into manageable batches and process them in bulk. You can use a scheduled flow to run a batch job and track the job status and health with Monitor Workflow Services.

The Calculate Rebate Payout page showing details of the batch job

Salesforce Flows: Salesforce Flow collects data and performs actions in your Salesforce org or an external system. To automate a particular business process, you can use any of the predefined flows or design your own flow by combining various elements, triggers, connectors, and resources. Flows help you automate the rebate-calculation process using DPE jobs. You can schedule flows to run at set times that are best for your business.

The Run Rebates DPE Jobs page showing flow details

Cindy clones the predefined DPE definitions, flows, and batch jobs and repurposes them to meet the requirements of Rayler Parts. Cloning ensures that she has an untampered copy, even if someone makes changes to the original templates.

Now it’s time for Cindy to understand how each template is tailored for rebate programs. 

Go with the Flow

Cindy meets with Rishi and other rebate program managers to explain what she has learned about the templates. Here’s what Cindy finds out about the predefined flows.

Flow Description

Rebate Orchestration Flow

Run this flow for end-to-end rebate calculations if your rebate programs and calculations don’t require a lot of customizations. The Rebate Orchestration Flow searches for DPE definitions with a Process Type of Rebates. It then triggers the calculation process to generate payout amounts. This flow includes the Run Rebate DPE Jobs, Run Rebate Payout Calculations, Calculate Rebate Amount, and Run Rebate Post Payout Actions flows.

Rebate Orchestration Flow 2

This is a simpler and more scalable version of the Rebate Orchestration Flow. This flow includes the Run Rebate DPE Jobs, Run Rebate Payout Calculations 2, Calculate Rebate Amount, and Run Rebate Post Payout Actions 2 flows.

Run Rebate DPE Jobs

This flow runs DPE definitions to aggregate data for payout calculations and generates records. Run this flow if you only want to use DPE definitions for rebates.

Run Rebate Payout Calculations

This flow calculates payout amounts from DPE definitions and batch jobs and creates or updates records in the relevant objects. Program managers can view payout amounts across the objects and check types, members, and so on. 

The payout amount is calculated whenever the Rebate Orchestration Flow runs. This gives you full visibility into the current payout amount before the final payout calculation date.

Run Rebate Payout Calculations 2

This flow only processes aggregate records that have changed since the last batch execution date.

Calculate Rebate Amount

Use this flow to manage multiple batch runs of standard batch jobs that process aggregate records and calculate the rebate amount.

Run Rebate Post Payout Actions

This flow triggers post-payout actions and closes the period on the calculation date.

Run Rebate Post Payout Actions 2

In addition to triggering post-payout actions, this flow updates the last calculation date of the rebate payout.

The Flows page in Setup showing a list of predefined flows

Apart from predefined flows, you also get individual flow actions that you can use to customize a flow. Flow actions are directed at granular tasks within the rebate flow, such as enrolling members, getting benefits and rebate amounts without inserting them into payout objects, generating payout periods, and more. 

Process Your Data

Next, Cindy explains to Rishi what each DPE definition does.

Note

To run a DPE in your org, you must enable Data Pipelines. With Data Pipelines, you can query and compute data available in your Salesforce org. To find out more about the required permission sets and object access, see Permissions to Work with Data Processing Engine.

DPE Definition Description

Aggregate by Member*

This DPE definition extracts data from rebate programs, filters transaction journal records by member, and aggregates the data accordingly. The aggregated amount by member for a specific payout period is created or inserted as a value in the Rebate Member Product Aggregate object. 

Aggregate by Member with Aggregate Item Details*

In addition to the transformations performed by the Aggregate by Member DPE, this DPE definition creates one record for each qualified transaction journal record in the Rebate Member Aggregate Item object. Use this definition to see how each qualified transaction contributes to the aggregated amount for a member.

Aggregate by Account*

If an account is a part of multiple rebate programs, use this DPE definition to aggregate eligible transactions for each rebate type in separate records. The transactions are aggregated at the account level, and not the member level, for each payout period.

Aggregate by Product and Member*

This DPE definition extracts data from rebate programs and filters transaction journal records to group data by member and product. In case you add more products or product categories while defining rebate program benefits, Aggregate by Product and Member takes care of that. 

Process Per Transaction Using Member*

If your payouts are calculated at every transaction or claim level, you can process each transaction record of a member and generate a payout amount for that transaction.

Account Hierarchy Member Aggregate Using Member*

If multiple accounts in a hierarchy are members of the same rebate program, you can aggregate the subaccount transactions at the parent-account level and generate a payout amount for the parent account.

Ship & Debit Program Aggregate Using Member*

In a ship-and-debit rebate program, enrolled members get special benefits if they sell to a preferred ship-to member. Use this DPE definition to validate the claim amount submitted by a member against the rebate program details such as the program reference number and ship-to account name. The eligible transactions are then aggregated to generate a payout amount. 

Year Over Year Growth Aggregate Using Member*

For growth-based rebates, this DPE definition looks for transaction records of members in the current payout period and compares the records with corresponding records of the same payout period in the previous year. It then aggregates the data to generate the total quantity and transaction value for the current period and the same period in the previous year.

Insert Orders to Journal with Member

This DPE definition filters all sales order records processed between the start and end date of an active rebate program. It then copies the order records into transaction journal records for payout calculations.

Rebate Calculations Post Processing

After the rebate calculations are completed using the Rebate Orchestration Flow 2, this DPE definition updates the last calculation date of the rebate payout and sets the payout status to Calculated. It also closes payout periods with payout calculation dates in the past.

Note

For the DPE definitions with asterisks (*), the aggregated data is written back to the Rebate Member Product Aggregate object.

Cindy can customize these definitions to write back to a custom object of her choice in case she wants to use a different object for aggregation. She can also use different grouping criteria or populate additional fields.

The Data Processing Engine page showing a list of definitions for rebates

If you want to customize the aggregation logic by region or introduce additional rules in the process, update an existing DPE definition or create your own from the template.

Batch It Up

Lastly, Cindy explains to Rishi how batch jobs work. Once eligible transaction records are filtered and aggregated by DPE definitions, a batch job processes them in multiple batches. Cindy can modify one of the batch jobs or create her own. The two, predefined jobs for Rebate Management follow.

  • Calculate Rebate Payout: This batch job processes records in batches of 200 and is used in the Rebate Orchestration Flow.
  • Calculate Rebate Payout for All Periods: This batch job processes records in batches of 2000 and is used in the Rebate Orchestration Flow 2.

The Batch Management page showing the Calculate Rebate Payout batch job

Get Your Rebates Approved

One of the proposed solutions in Rishi’s report is that supervisors and executives should have tighter control over rebate processes because the financial implications are significant. 

After a discussion with Rishi, Cindy sets up an approval process for the following task flows.

  • Enrolling members into a rebate program
  • Activating the rebate program
  • Adjusting the rebate payout amount

Since Rayler Parts has been using Salesforce applications for a long time and approvals are part of standard functionality, Cindy is well-versed with approval process setup. To learn more about setting up approval processes, see Approvals for Rebate Management.

In the next unit, Rishi creates a rebate program based on the incentives model he discussed with Mahira and Mehmood.

Resources

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities