Use validation rules to check if the data is in line with the defined standards.
To validate data, you can use several validation types. This topic explains how to set up the Custom validation type.
Use a custom validation to validate a field value using a custom validation class.
Before you can set up a custom validation rule, ensure that the custom validation class is developed.


Data quality administrator Data quality administrator Developer Developer Start Start Need new custom  validation class? Need new custom  validation class? Inform a developer  on the validation class  to be developed Inform a developer  on the validation class  to be developed Develop custom validation class Develop custom validation class You can use a custom validation rule to validate a field value using a custom validation class.To set up a custom validation rule, first develop the custom validation class to be applied.The custom validation class must extend the DQSCustomValidationBase base class.When you extend the DQSCustomValidationBase base class:Enter a unique and recognizable description() for the class. The description is shown in the lookup of the Class name field of a custom validation rule.Use these methods to indicate to which data the custom class is applicable:getTablesList(): You can define the tables to which the custom class applies. As a result, you can select the custom class for a custom validation rule with one of the applicable tables defined.getExtendedDataTypesList(): You can assign extended data types to which the custom class applies, for example, 'ExternalItemId'. As a result, you can select the custom class for a custom validation rule with a field defined that uses the same extended data type.getBaseTypesList(): You can define base data types to which the custom class applies, for example, String or Date. As a result, you can select the custom class for a custom validation rule with a field defined with the same data type.Use the validateRecord() method to define the x++ code that runs the validation. This code must return one of these values:True: The value in the validation rule field is valid.False: The value in the validation rule field is invalid.The base structure of an extended DQSCustomValidationBase class is: Inform the data quality  administrator that the  validation class is available Inform the data quality  administrator that the  validation class is available Set up validation rule of type Custom Set up validation rule of type Custom Use validation rules to check if the data is in line with the defined standards. To validate data, you can use several validation types. This topic explains how to set up a validation rule of type Custom. Use a custom validation rule to validate a field value using a custom validation class. Before you can set up a custom validation rule, ensure that the custom validation class is developed. Procedure 1. Click Data quality management. 2. On the Data quality policies tab, in the list, click the link of the desired data quality policy. 3. On the Validation rules tab, click Add. Note: If you want to edit another data quality policy version than the currently shown version, first select the desired version. To do so, on the Action Pane, on the Version tab, click Versions. On the dialog, select the desired version and click OK. 4. In the Table field, enter or select a value. 5. In the Field field, enter or select a value. 6. In the Validation type field, select 'Custom'. 7. In the Event field, select an option. 8. Define what is done if the validation rule is not met: - Warning: A warning message is shown. The record or the field value is saved. - Error: An error message is shown. The record or the field value is not saved. In the Warning/Error field, select an option. Note: For each validation rule, you can define a message to be shown. If you do not define a validation rule message, a default message is shown. 9. Sub-task: Set the validation rule properties. 10. Define the custom validation class to be applied for the validation rule. On the Properties tab, in the Class name field, enter or select a value. Note: You can only select classes that extend the DQSCustomValidationBase base class. 11. Close the page. Notes Several validation rule tutorial classes are provided with the Data quality studio. These tutorial classes serve as an example of custom classes for a custom validation rule and are not supported. You can customize the tutorial class as desired. If you want to do so, you are advised to create a copy of the tutorial class, and make the changes in the copy. Tutorial class Description DQTCustomValidation_GS1checksum This tutorial class checks if the length of an entered bar code is according to the GS1 bar code standards. To do this, the check digit is considered. An entered bar code is valid if it matches one of the GS1 bar code standards, as defined in the tutorial class. Note: The length of an entered bar code is checked against several GS1 bar code standard lengths, as defined in the tutorial class. If desired, you can customize the class, for example, to remove standard lengths you do not use. DQTCustomValidation_OrderAccountChange For sales orders and purchase orders, you can change the customer account, vendor  account, or invoice account. However, if already journals are posted for an order, it is often not desired to have an account changed. For the: SalesTable, you can set up a custom validation rule to validate the customer account or invoice account. PurchTable, you can set up a custom validation rule to validate the vendor account or invoice account. On entering or changing the applicable account number on the applicable order, this tutorial class checks: Does a posted confirmation journal, packing slip journal, or invoice journal exist for the order? If so, does the account number, as entered or changed for the order, match the account number on the posted journal? If the entered account number does not match the account number on the posted journal, an error or warning message is shown. End End No Yes

Activities

Name Responsible Description

Develop custom validation class

Developer

You can use a custom validation rule to validate a field value using a custom validation class.
To set up a custom validation rule, first develop the custom validation class to be applied.
The custom validation class must extend the DQSCustomValidationBase base class.
When you extend the DQSCustomValidationBase base class:
  • Enter a unique and recognizable description() for the class. The description is shown in the lookup of the Class name field of a custom validation rule.
  • Use these methods to indicate to which data the custom class is applicable:
    • getTablesList(): You can define the tables to which the custom class applies. As a result, you can select the custom class for a custom validation rule with one of the applicable tables defined.
    • getExtendedDataTypesList(): You can assign extended data types to which the custom class applies, for example, 'ExternalItemId'. As a result, you can select the custom class for a custom validation rule with a field defined that uses the same extended data type.
    • getBaseTypesList(): You can define base data types to which the custom class applies, for example, String or Date. As a result, you can select the custom class for a custom validation rule with a field defined with the same data type.
  • Use the validateRecord() method to define the x++ code that runs the validation. This code must return one of these values:
    • True: The value in the validation rule field is valid.
    • False: The value in the validation rule field is invalid.
The base structure of an extended DQSCustomValidationBase class is:

Set up validation rule of type Custom

Data quality administrator

Use validation rules to check if the data is in line with the defined standards.
To validate data, you can use several validation types. This topic explains how to set up a validation rule of type Custom.

Use a custom validation rule to validate a field value using a custom validation class.
Before you can set up a custom validation rule, ensure that the custom validation class is developed.

Provide feedback