Custom validation to prevent a promotion increase without actual job promotion
In the model company design of the promotion section of a compensation/salary planning worksheet nothing prevents a planner from entering a promotion increase ($ amount) without actually selecting a new Job Classification for an employee from the “Promote” popup.
Reason for this topic / Problem :
For data consistency purposes customers may want to only allow planners to save a promotion increase for an employee once that employee’s Job Classification has been changed in the “Promote” tool.
However there are no standard columns or features that capture this requirement.
We need to add a new custom column in our template next to the promotion recommendation column and configure a custom validation formula in it as per the screenshot below.
After the worksheet is launched a planner who entered a promotion increase before using the “Promote” popup will get the following messages on mouse-over and on save :
Custom validations can contain complex formulas but are limited as of 2H 2023 to 20 columns in Compensation and Total Compensation templates only (they are not supported in Variable Pay yet).
As a workaround to this 20 columns limit we can use the instructions tab of a worksheet to display an unlimited number of warning or error messages (workaround designed by Skip Jones from SAP below). As of 2H 2023 the Instruction tab can be relabeled by template which makes this design easier for customer with large numbers of errors or very long error messages.
All materials in this article were inspired by recent implementations that are now live. Please highlight if you see anything that needs to be corrected or if you have encountered easier ways to meet customer requirements on this particular topic.
All the best,
(If you found this blog useful please consider giving it a Like)
For consultants with provisioning access, please find below the promotion custom validation column code snippet below :
<comp-field-definition id="customValidationPromotion" isCustomField="true" isVisible="true" type="string" useFor="salary" readOnly="true" hidePercentage="false" hideAmount="false" percentageReadOnly="false" reloadable="false" displayOrder="38"> <comp-field-label><![CDATA]></comp-field-label> <comp-custom-field-formula><![CDATA[if(finPayGrade=payGrade && promotion > 0,"*","")]]></comp-custom-field-formula> <comp-custom-validation validationType="hard"> <comp-custom-validation-formula><![CDATA[if(finPayGrade=payGrade && promotion > 0,"false","true")]]></comp-custom-validation-formula> <comp-custom-validation-warning> <comp-custom-validation-warning-title><![CDATA[Please promote the employee using the Promote tool (3 dots next to employee's name) before entering a $ amount.]]></comp-custom-validation-warning-title> <comp-custom-validation-warning-message><![CDATA[Please promote the employee using the Promote tool (click on the three dots next to the employee name) before entering a $ amount.]]></comp-custom-validation-warning-message> </comp-custom-validation-warning> </comp-custom-validation> </comp-field-definition>