Define Accrual Rules
Learning Objectives
After completing this project, you’ll be able to:
- Define the eligibility rules for accruals.
- Create flows to credit points based on the eligibility rules.
- Use a template to calculate and update the qualifying points balance.
- Create a batch job to process accruals.
- Create a flow to invoke the batch and Data Processing Engine actions.
Inner Circle Accrual Rules
Cloud Kicks is a manufacturer of stylish and comfortable custom sneakers. It runs a loyalty program called Cloud Kicks Inner Circle. The loyalty program has a well-defined tier structure, rewards, and associated program partners and partner products.
Linda Rosenberg, the loyalty admin for Cloud Kicks, wants to set up an accrual process for the program. An accrual process contains rules or conditions that define how members get rewarded or accrue points: How many points would a member get? What kind of points do they get? Will they get points only for purchases, or for both purchases and engagement activities?
Linda reviews the rules she needs for the accrual process. When members purchase something, they get Regular Points, or non-qualifying points, based on their tier and transaction amount. These points are credited to them in real-time, as soon as the transaction is processed. Along with non-qualifying points, members get Tier Points, or qualifying points, which are equal to the transaction amount but not affected by the tier status. These points are credited to them in real-time, as soon as the transaction is processed. The rules for purchase-based accruals are as follows.
Tier | Non-qualifying Points | Based On |
---|---|---|
Silver and Gold | 1 point per dollar | Transaction Amount |
Diamond and Platinum | 2 points per dollar |
Members are also rewarded for non-purchase activities that involve engaging with the brand and the loyalty program. Here are the rules for non-purchase activities.
Activity | Non-qualifying Points |
---|---|
App downloads | 50 |
Customer survey completions | 100 |
Social media mentions | 50 |
Points related to engagement activities are loaded into Loyalty Management every night so these accruals will be processed in a batch. Along with non-qualifying points, all members get 10 qualifying points irrespective of the activity.
Here’s a breakdown of the steps involved in the accrual process.
Real-Time Processing
For real-time accruals, a flow is created to process transaction journals and credit points. The non-qualifying and qualifying points balance is updated as soon as the transaction is processed.
Batch Processing
For batch processing, accruals are processed using flows and batch management. A flow is set up to define the rules and credit points. A batch is created to process transaction journal records in the pending state and is scheduled to run using a flow.
In this project, we follow along as Linda sets up an accrual process based on these rules.
Sign Up for a Developer Edition Org with Loyalty Management
To complete this project, you need a special Developer Edition org that contains Loyalty Management and our sample data. Get the free Developer Edition and connect it to Trailhead now so you can complete the challenges in this project.
Note that this Developer Edition is designed to work with the challenges in this badge, and may not work for other badges. Always check that you’re using the Trailhead Playground or special Developer Edition org that we recommend.
- Sign up for a free Developer Edition org with Loyalty Management.
- Fill out the form. For Email, enter an active email address. For Username, enter a username that looks like an email address and is unique, but it doesn’t need to be a valid email account (for example, yourname@lm4ever.com).
- After you fill out the form, click Sign me up. A confirmation message appears.
- When you receive the activation email (this might take a few minutes), open it and click Verify Account.
- Complete your registration by setting your password and challenge question.
Tip: Write down your username, password, and login URL for easy access later. - You are logged in to your Developer Edition.
Now connect your new Developer Edition org to Trailhead.
- Make sure you're logged in to your Trailhead account.
- In the Challenge section at the bottom of this page, click the playground name and then click Connect Org.
- On the login screen, enter the username and password for the Developer Edition you just set up.
- On the Allow Access? screen, click Allow.
- On the Want to connect this org for hands-on challenges? screen, click Yes! Save it. You are redirected back to the challenge page and ready to use your new Developer Edition to earn this badge.
Now that you have a Loyalty Management-enabled org, let’s go about setting up the accrual process.