--- title: "Develop custom validation class" slug: "develop-custom-validation-class" description: "Learn to create custom validation rules in X++ by extending the DQSCustomValidationBase class for effective field value validation." tags: ["Task topic"] updated: 2026-03-20T08:29:36Z published: 2026-03-20T17:44:40Z canonical: "docs.staedean.com/develop-custom-validation-class" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # 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 applies: - **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:![](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/Images/File%20image95EF8287-B187-42B8-BE52-AAE8ADD291E9) ## Related - [Set up validation rule of type Custom](/set-up-validation-rule-of-type-custom-flow.md)