Custom validations exist for key business process and tenant specific (however the BPs that support Custom Validations are common across all WD tenants). The purpose of a custom validation is to prevent the submission of a business process if certain conditions are met. For example, we can use custom validations to prevent the creation of invoices without a cost centre (without making cost centre a required field).
Custom Validations contain configurable condition rules which Workday evaluates when the "Submit" button is pressed (at the initiation step of the BP).
Custom Validations are tenant wide and contain two types of validation:
- Critical - If triggered, it will give a critical error and prevent the BP from initiating
- Warning - If triggered, it will give a Warning message and allow the BP / transaction to continue
Creating Custom Validation Tests
When testing Customer validations, we will create negative tests to ensure each validation is working as expected, should the BP initiate and complete (assuming we are focusing on critical validations) this would be a failure. By searching for Maintain Custom Validations in Workday, you can see all of the BPs that have custom validations and the specific rules applied to each one (see screenshot below)
The example of a Custom Validation below is saying that a critical warning should be thrown if this criteria is met:
- If Company is in the list AND
- Cost Center is empty AND
- Ledger Account Type is either Expense OR Income
If this is triggered in Workday, an error message similar to the one below will be displayed.
So an example test in this case would be:
- Create a test for "Create Journal"
- Use "Global Modern Servies, Inc. (USA)" as the Company
- Choose a Ledger with account type "Expense"
- Leave the "Cost Center" blank