When you select Seniority Date in the Mapping Object drop-down list of a rule's details in HR Admin > Employee Data Mapping Rules, the ShortName-XRefCode drop-down list shows the Expression Builder button. Click Expression Builder to open the Expression Builder dialog box, where you can create an expression to reset or bridge a seniority date when an employee is rehired:
In the Variable Library tab, there are four date tokens that can be included in the seniority date expression:
- RehireDate
- TerminationDate
- OriginalHireDate
- ExistingSeniorityDate
For example, a mapping rule can assign the seniority date as follows:
- Use the employee's Rehire Date if more than 60 days have passed between their Termination Date and Rehire Date.
- Use the employee's Original Hire Date if fewer than 60 days have passed between their Termination Date and Rehire Date.
To configure this, add the following expression to the text editor:
if(TerminationDate > 0)
{
if(RehireDate - TerminationDate > 60) {return RehireDate;}
else {return OriginalHireDate;}
}
else {return OriginalHireDate;}
The if(TerminationDate > 0) line at the beginning of the expression is used to handle the case where the employee's termination date is undefined.