Redwood Individual Compensation VBS Validation Cap
Summary:
Redwood Individual Compensation - we would like to implement a cap on Redwood Individual Compensation which prevents the Line Manager from submitting more than one Reward Payment in a 12 months rolling period. The message "Maximum frequency limit is reached" This employee has already received a reward payment within the last 366 days
Validation not working on setup. The message appears for all entries.
Version (include the version you are using, if applicable):
Redwood ICP 26A
Code Snippet (add any code snippets that support your topic, if applicable):
This is our Java script:
/* eslint-disable dot-notation */define([], () => { 'use strict'; /** * Validates reward type for the current 366-day period * @param {string} rewardType * @param {boolean} alreadyGiven2Percent * @returns {Object} formulaStatus and formulaMessage */ function validateRewardType(rewardType = '', alreadyGiven2Percent = false) { let formulaStatus = 'S'; let formulaMessage = ''; const normalizedType = rewardType.trim().toLowerCase(); // Only block if a second 2% reward is being given in the same 366-day period if (normalizedType.includes('2%') && alreadyGiven2Percent) { formulaStatus = 'E'; formulaMessage = 'A 2% reward has already