Salary
This topic lists the implementation considerations for Salary processes.
Change Salary
You can typically use field value defaulting and validation in these cases.
- Default the proposed salary basis when employee legal employer is Vision when line managers propose salary change.
- Default the effective date to current date and next salary review date to 1 year after the effective date, when line managers propose salary change.
- Default the salary basis based on assignment flexfields when line managers propose salary change.
- Default salary basis for a full time employee belonging to US and a certain grade.
- Validate that the when date isn't in the past.
- Validate that the salary amount isn't below a minimum value.
- Validate that the when start date is 1st of next month.
- Validate that the user hasn't changed the rate component value.
This table lists the supported attributes, exceptions, and the implementation recommendations for the Change Salary page.
It applies to both pages under My Team and My Client Groups tabs.
In the Conditions | To Default Field Values | To Validate Field Values | Implementation Guidelines |
---|---|---|---|
|
|
|
Defaulting
|
Salary History
You can typically use field value defaulting and validation in these cases.
- Default the proposed salary basis based on the employee's legal employer when compensation managers propose a salary change.
- Default the effective date to first day of next month and next salary review date to 1 year after the effective date, when line managers propose a salary change.
- Default the salary basis based on assignment flexfields when proposing salary change, .
- Validate that users don't enter retro-active salary changes.
- Validate that the change of salary occurs on the first of the month.
- Validate that the salary amount is above a minimum value.
- Validate that users don't change a simple component value.
- Validate that users don't enter a zero value for a simple component.
- Validate the sum of a certain simple component is based on a formula (Adjustment needs to be sum of all components minus cost of living).
This table lists the supported attributes, exceptions, and the implementation recommendations for Salary History.
It applies to the Admin Salary History page accessed from My Client Groups tab.
In the Conditions to Default Values | To Default Field Values | In the Condition to Validate Values | To Validate Field Values | Implementation Guidelines |
---|---|---|---|---|
|
|
|
Not Applicable |
|
Examples
Validate that the user hasn't changed the rate component value
Advanced Expression
/* eslint-disable dot-notation */
define([], () => {
'use strict';
/**
*
* @param {object} context
* @return {boolean}
*/
function runCondition(context) {
const { $componentContext, $fields, $modules, $user } = context;
let salBasisType = $fields.compensationSalaries.SalaryBasisType.$value();
if(salBasisType == 'R'){
let newSalaryBasisId = $fields.compensationSalaries.SalaryBasisId.$value();
let curSalaryBasisId = $fields.compensationSalaries.SalaryBasisId.$initialValue();
if(newSalaryBasisId != curSalaryBasisId){
return false;
}
let curValue = 0;
let newValue = 0;
let curComponentsArray = $fields.compensationSalaries.salaryPayRateComponents.$initialValue().items;
for(let i in curComponentsArray){
let cmpt=curComponentsArray[i];
if(cmpt.Name == 'ZCMP GSP RATE BASE'){
curValue = Number(cmpt.RateAmount);
}
}
let componentsArray = $fields.compensationSalaries.salaryPayRateComponents.$value().items;
for(let j in componentsArray){
let cmpt=componentsArray[j];
if(cmpt.Name == 'ZCMP GSP RATE BASE'){
newValue = Number(cmpt.RateAmount);
}
}
if(curValue != newValue){
return true;
}
}
return false;
}
return { runCondition };
});
Validate that a value is provided for the rate component
Advanced Expression
/* eslint-disable dot-notation */
define([], () => {
'use strict';
/**
*
* @param {object} context
* @return {boolean}
*/
function runCondition(context) {
const { $objectContext, $fields, $modules, $user, $value } = context;
let salary = $fields['compensationSalaries'].$value();
let payRateComponents = salary['salaryPayRateComponents'];
if (payRateComponents) {
let componentsArray = payRateComponents.items;
if (componentsArray) {
for (let i = 0; i < componentsArray.length; i++) {
let element = componentsArray[i];
if (element.Name === 'ZCMP RTS USVS ARS Base Salary' && element.RateAmount == 0) {
return true;
}
}
}
}
return false;
}
return { runCondition };
});
Validate that the sum of a certain simple component needs to be based on a formula (Adjustment needs to be sum of all components minus cost of living)
Advanced Expression
/* eslint-disable dot-notation */
define([], () => {
'use strict';
/**
*
* @param {object} context
* @return {boolean}
*/
function runCondition(context) {
const { $componentContext, $fields, $modules, $user } = context;
let salBasisType = $fields.compensationSalaries.SalaryBasisType.$value();
let sum = 0;
let result = 0;
let difference = 0;
if(salBasisType == 'C'){
let componentsArray = $fields.compensationSalaries.salaryComponents.$value().items;
for(let i in componentsArray){
let cmpt=componentsArray[i];
if(cmpt.ComponentReasonCode == 'ADJUSTMENT'){
result = Number(cmpt.AdjustmentAmount);
}
else if(cmpt.ComponentReasonCode == 'COST_OF_LIVING'){
difference += Number(cmpt.AdjustmentAmount);
}
else{
sum += Number(cmpt.AdjustmentAmount);
}
}
if(result != sum - difference){
return true;
}
}
return false;
}
return { runCondition };
});
Default the effective date to current date and next salary review date to 1 year after the effective date, when line managers propose salary change
Advanced Expression
/* eslint-disable dot-notation */
define([], () => {
'use strict';
/**
* Default value expression for whenAndWhy.StartDate
* @param {object} context
* @return {date}
*/
function getWhenAndWhyStartDate(context) {
const { $objectContext, $fields, $modules, $user } = context;
let date = new Date();
let firstDay = new Date(date.getFullYear(), date.getMonth()+1, 1);
let year = firstDay.toLocaleString("default", { year: "numeric" });
let month = firstDay.toLocaleString("default", { month: "2-digit" });
let day = firstDay.toLocaleString("default", { day: "2-digit" });
return (year + "-" + month + "-" + day);
}
return { getWhenAndWhyStartDate };
});
Validate that the user hasn't changed the simple component value
Advanced Expression
/* eslint-disable dot-notation */
define([], () => {
'use strict';
/**
*
* @param {object} context
* @return {boolean}
*/
function runCondition(context) {
const { $componentContext, $fields, $modules, $user } = context;
let salBasisType = $fields.compensationSalaries.SalaryBasisType.$value();
if(salBasisType == 'ORA_SIMPLE_COMPONENTS'){
let newSalaryBasisId = $fields.compensationSalaries.SalaryBasisId.$value();
let curSalaryBasisId = $fields.compensationSalaries.SalaryBasisId.$initialValue();
if(newSalaryBasisId != curSalaryBasisId){
return false;
}
let curValue = 0;
let newValue = 0;
let curComponentsArray = $fields.compensationSalaries.salarySimpleComponents.$initialValue().items;
for(let i in curComponentsArray){
let cmpt=curComponentsArray[i];
if(cmpt.ComponentCode == 'ORA_WAGE_PROGRESSION_RATE'){
curValue = Number(cmpt.Amount);
}
}
let componentsArray = $fields.compensationSalaries.salarySimpleComponents.$value().items;
for(let j in componentsArray){
let cmpt=componentsArray[j];
if(cmpt.ComponentCode == 'ORA_WAGE_PROGRESSION_RATE'){
newValue = Number(cmpt.Amount);
}
}
if(curValue != newValue){
return true;
}
}
return false;
}
return { runCondition };
});
Validate that user hasn't entered a zero value for a simple component
Advanced Expression
/* eslint-disable dot-notation */
define([], () => {
'use strict';
/**
*
* @param {object} context
* @return {boolean}
*/
function runCondition(context) {
const { $componentContext, $fields, $modules, $user } = context;
let salBasisType = $fields.compensationSalaries.SalaryBasisType.$value();
if(salBasisType == 'ORA_SIMPLE_COMPONENTS'){
let componentsArray = $fields.compensationSalaries.salarySimpleComponents.$value().items;
for(let i in componentsArray){
let cmpt=componentsArray[i];
//To Check if specific component has 0 amount value
// if(cmpt.ComponentCode == 'ORA_WAGE_PROGRESSION_RATE' && cmpt.Amount==0){
// return true;
// }
//To Check if any component has 0 amount value
if(cmpt.Amount==0){
return true;
}
}
}
return false;
}
return { runCondition };
});