The enhancement will allow specific customers to roll over their reward points from year to year. Here’s a breakdown of the new logic:
- Customer Checkbox Addition: A new checkbox, “Rewards Do Not Expire,” will be added to the customer record to determine whether rewards should roll over. If checked, the rewards will carry forward instead of expiring.
- Rewards Earned Record Fields: Two new fields will be added: Previous Year Reward Balance (tracks the prior year’s carried-over balance) and Total Reward Earned (combines previous and current year’s rewards).
- Scheduled Reward Expiry and Carry Forward Process:
- The reward expiration and carry-forward process is scheduled to run every year on January 1st at 12:00 AM. During this process, the customer’s “Rewards Do Not Expire” field will determine whether rewards expire or carry forward to the next year.
- If the “Rewards Do Not Expire” checkbox is checked, the script will retain last year’s rewards without automatically removing them, and they will be included in the new year’s rewards calculation by creating a new reward earned record and the old record will be marked as inactive.
- If the “Rewards Do Not Expire” checkbox is unchecked during the scheduled process, the rewards will not carry forward to the next year. If the checkbox is checked afterwards, last year’s rewards will not be retrieved and will remain expired. The same process will occur again the following year. the old record will simply be marked as inactive.
- Users must ensure that the “Rewards Do Not Expire” checkbox is correctly set before the scheduled yearly process on January 1st. Any changes to the “Rewards Do Not Expire” field after the scheduled process is completed will not affect the previous year’s rewards, meaning the script will neither retrieve nor expire them. Therefore, the “Rewards Do Not Expire” setting must be finalized before the scheduled process runs. Otherwise, any necessary adjustments will need to be handled manually.
4. Reward Creation: The current reward calculation logic remains unchanged. When creating or updating a reward-earned record, the “Reward Earned” field will reflect the current year’s earned amount based on customer purchases. The “Total Reward Earned” field will be calculated as the sum of the “Previous Year Reward Balance” and the “Current Year Reward Earned.” For newly created records, the “Previous Year Reward Balance” will be initially set to 0.
5. Updates to Other Scripts: Updates to other scripts will involve fetching the reward-earned amount from the “Total Reward Earned” field. These updates will be applied to the Reward Store (Map/Reduce Script), Reward Redeem (User Event Script), Reward Reminder Notification (Map/Reduce Script), and Report & Dashboard (Suitelet).
6. Parent-Child Account Logic: Rewards will be carried forward or expire separately for parent and child customers, based on their individual preferences. After rewards are carried forward or expire, the parent customer will be able to redeem the total reward points of the child customers, as per the current functionality.