Skip to Content
Technical Articles

Custom validation to prevent a promotion increase without actual job promotion

Overview 

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.

 

 

Solution 

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 :

 

 

 

Conclusion

Custom validations can contain complex formulas but are currently (as of 1H 2020) limited to 3 fields per template.

As a workaround to this 3 fields 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) – click to zoom in :

 

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.

 

 

 

 

Appendix 

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>

9 Comments
You must be Logged on to comment or reply to a post.
  • Xavier, can we handle the following scenario as well:

    When any employee gets promoted in promotion screen, planner should enter some amount in promotion column on the compensation worksheet. Can we add a validation to not allow the planner to save the worksheet without entering amount in promotion column?

  • Hello Xavier

    My requirement:

    When any employee gets promoted in promotion screen, planner should enter some amount in promotion column on the compensation worksheet. Can we add a validation to not allow the planner to save the worksheet without entering amount in promotion column?

    I tried with the configuration you mentioned, but not working as expected.

    Thanks

    Sreekanth

     

    • And here is the xml code snippet for the column for what you are trying to do :

      <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″ reportable=”true”>
      <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[Promotion increase is mandatory when an employee is promoted through the Promote tool.]]></comp-custom-validation-warning-message>
      </comp-custom-validation-warning>
      </comp-custom-validation>
      </comp-field-definition>

  • Thank you so much Xavier. The code is working correctly now.

    But when we hide/remove change/view permission on the worksheet, this validation is not working. Can we make this work even when the field is hidden/not visible on the worksheet.

    Thanks

    Sreekanth

  • Hi Xavier Le Garrec,

     

    Could you please elaborate on another product feature of SF Compensation Promotions, which was released recently in H1 2020 – Expanded Pay Range Matching for Promoted Employees.

    It talks about using getting the final pay ranges based on new data for the promoted employees. Can you suggest which field can be used here? Can I use Final Pay Grade?

    Thanks,

    Megha