Use a Named Rule

XML Forms Guide

Version
R2026.1.1
ft:lastEdition
2026-05-11
Use a Named Rule

Named rules are predefined validations that you can use without defining them yourself.

To use a named rule validation, include the following elements:

  • a <ValidationRule> tag where Type=the name of the rule
  • a ValidationFailureMessage parameter

The ValidationFailureMessage parameter provides the error message to be shown if the form data doesn’t satisfy the rule. You can use a literal string, or a variable that can be localized.

For example:

Copy
<ValidationRule Event="OnSubmit" 
    Type="MustHaveExactlyOnePrimaryResidenceRule">
    <Parameter Name="ValidationFailureMessage">
        You cannot designate multiple addresses as your 
        primary residence.
    </Parameter>
</ValidationRule>
Available named rules
Rule Name Description
AssignedSexAndGenderIdentityValidationRule Enforces validation rules for an employee's assigned sex and gender identity in an XML form.
BirthDateGreaterThanPreStartDateValidationRule Ensures that the value in the Birth Date field is greater than the value in the Start Date field.
ConfidentialIDNewhireValidationRule Validates the confidential identification of new hire employees and ensures that confidential identification isn't deleted during the new hire process.
ConfidentialIDRehireValidationRule Ensures that primary confidential identification types are not deleted during the rehire process.
CountyRequiredForPrimaryAddressRule Ensures that primary addresses in the US include necessary county information, based on the state and country code.
ElectronicStatementAcknowledgementRule Ensures that the policy acknowledgment checkbox is selected when the user submits the form.
EmailsMustBeValidRule Ensures that the email addresses provided for an employee and their emergency contacts are valid and not missing.
EmergencyContactMustHaveRelationshipTypeRule Ensures the following:
  • That the employee's emergency contacts are configured with a relationship type.
  • That first and last names are entered for the emergency contact.
EmergencyContactValidationRule Ensures that the First Name, Last Name, and Phone Number fields in the Emergency Contacts section of forms are filled out. The rule only runs if at least one setting in the Emergency Contacts section is filled out, so that users can still submit the form without adding any emergency contact information.
EmployeeLeaveOfAbsenceFutureWorksheetsValidationRule

Ensures that the employee doesn't have future-dated timesheet entries that would prevent you from setting them to inactive status when they make a leave of absence request.

If the Prevent Employee Termination if Future Timesheet Entries Exist client property is set to All entries or Worked time only, the FutureWorksheetsValidationRuleBase Validate() function accepts an optional workedTimeOnly = false parameter that returns only EmployeePunches if true.

EmployeeLoginIdMustBeUniqueRule Ensures that the employee's user name is unique in Dayforce.
EmployeeNumberMustBeUniqueRule Ensures that the employee's employee number is unique in Dayforce.
EmployeeOnboardingPolicyRule Ensures that new or updated employee onboarding policies don't overlap with existing policies and that they are valid for internal hires.
EmployeePersonalDetailsValidationRule Validates the personal details of an employee in an XML form.
EmployeeSingleSignOnValidationRule Validates an employee's single sign-on login name in an XML form.
EmployeePhoneNumberValidationRule Ensures that the employee's phone numbers are in a valid format.
EmployeeRateAndSalaryGreaterThanJobPayGradeRule Ensures that the employee's pay rate is greater than the minimum value configured for the pay grade associated with the employee's job.
EmployeeRateGreaterThanMinimumWageRule Ensures that the employee's pay rate is greater than the minimum wage value configured for the geographic location (province, territory, state, or specific city) based on the employee's work location.
EmployeeRateIsRequired Ensures that there is a value in the Employee Rate field.
EmployeeTerminationFutureWorksheetsValidationRule

Ensures that the employee doesn't have future-dated timesheet entries that would prevent you from setting them to terminated status.

If the Prevent Employee Termination if Future Timesheet Entries Exist client property is set to All entries or Worked time only, the FutureWorksheetsValidationRuleBase Validate() function accepts an optional workedTimeOnly = false parameter that returns only EmployeePunches if true.

EmployeeUnionValidationRule Ensures that inactive unions aren't selected in an XML form.
EmployeeZipCodeValidationRule Ensures that the employee's ZIP Code or postal code is in a valid format.
FutureDatedDirectManagerWarning Validates future-dated direct manager assignments in an employee's workflow and shows a warning.
JobReq_FieldValidationRules Validates various fields within the job requisition form to ensure they meet specific criteria.
JobReq_FTEShouldBeBetween0And1 Validates that the FTE (full-time equivalent) field has a value of zero or one.
MinimumAgeRule Validates that the employee's birth date is greater than 16 years ago, based on today's date.
MustHaveExactlyOnePrimaryResidenceRule Ensures that the employee has one and only one address marked as the primary residence.
MustHaveOpenPayPeriodRule

Ensures that pay adjustments are made in an open pay period for employees.

NoEmailForWelcomeMessageValidationRule Validates that a valid email address is provided for sending a welcome message to new employees.
NormalHoursGreaterThanZero Validates that the value in the Normal Hours field is greater than zero.
OnlyOneEffectiveStartPrimaryResidenceRule Ensures that the employee has one and only one primary residence address with a specified start date. If two or more primary address records are defined with the same effective start date, the form shows an error.
PreStartDateGreaterThanHireDateValidationRule Validates that the value in the prestart record is greater than (later than) the Hire Date field value.
RightToWorkBlankWarning Ensures that an employee's right to work details are populated on the form.
SocialSecurityNumberDuplicateRule If the employee’s National ID Number (for example, SSN or SIN) has changed, verifies that the new number isn’t a duplicate of an existing number.
SocialSecurityNumberExistRule Ensures that the employee's SSN or SIN was previously saved in an employee record. If the number isn’t associated with a terminated employee, because it doesn’t exist on any employee records or it’s associated with an employee that hasn’t been terminated, Dayforce shows a warning message.
SocialSecurityNumberValidationRule

Ensures that the employee's SSN or SIN is in a valid format.

This rule can be associated with the PreventRehireFromNewHireForm parameter, which can be configured with a 'True' or 'False' value. When the parameter is configured as 'True', the application shows an error message when the form is submitted for an employee whose SSN or SIN already exists in the application.

In addition, the rule needs an additional line to invoke the rule during the presave process:

<PreSaveProcess Type="DefaultNewHireXMLPreSaveProcess" PreventRehireFromNewHireForm="True" />

For more information, see the example below.

SocialSecurityNumberValueRequiredValidationRule Ensures that the US Social Security Number is only numeric and has a specified maximum limit.
TelecommuterPercentageValidationRule Validates the data that is entered into the Telecommuter % field. If a value outside 0-100 is entered, Dayforce shows an error message. Also, if a value is submitted in the Telecommuter % field for someone in a non-US pay group, Dayforce shows a warning message but the form can still be processed.
WorkAssignmentRateChangeAgainstPayGradeRule Ensures that if Restrict Out Of Grade is selected for the pay grade an employee belongs to, their job or alternate rate can’t be saved if it’s outside the minimum and maximum range.

Example: Using Named Rules

To configure a form that includes named rules, define the rules after the <DataClass> tag and before the <FormHeader>:

Copy
<WF_DynamicForm>
   <DataClass>Employee</DataClass>
    <ValidationRule Type="EmployeeLoginIdMustBeUniqueRule" 
        Event="OnSubmit" />
    <ValidationRule Type="EmployeeNumberMustBeUniqueRule" 
        Event="OnSubmit" />
    <ValidationRule Type="EmployeePhoneNumberValidationRule" 
        Event="OnSubmit" />
    <ValidationRule Type="SocialSecurityNumberDuplicateRule" 
        Event="OnSubmit">
        <Parameter Name="PreventRehireFromNewHireForm">
        True
        </Parameter>
    </ValidationRule>
    <ValidationRule Type="SocialSecurityNumberAndExpiryDateValidationRule" Event="OnSubmit" />
    <ValidationRule Type="CountyRequiredForPrimaryAddressRule" Event="OnSubmit" />
    <ValidationRule Type="EmployeeRateIsRequired" Event="OnSubmit" />
    <PreSaveProcess Type="DefaultNewHireXMLPreSaveProcess" PreventRehireFromNewHireForm="True" />
    ...
</WF_DynamicForm>