Configuring Relationship-Level Custom Validation
You can configure custom data validation at the relationship level. First, you create an Operation record and define metadata, and then link the operation to the relationship for which you want to configure validation. You then create and add Groovy code to implement custom validation logic.
|
The following procedure assumes that you have previously created an Operation record to validate a relationship.
|
To configure relationship-level custom data validation:
1. In
Max Designer, on the
Developer Tools (
) launchpad menu, click
Operations, and then in the list view, click the validator operation for the relationship you want to configure, for example,
Relationship Validator.
2. On the object page, on the
Overview tab, specify the following values, and then click
Save and Close (
).
Option | Value |
---|
Computer Language | Groovy |
Class Name | The name of the class used to implement custom validation logic. |
Method Name | validateRecord |
3. On the
Developer Tools (
) launchpad menu, expand the
Development Tools section and click
Relationships, and then in the list view, locate and open the
Relationship record to which you want to add custom validation.
4. On the record page, in the
Relations tab, in the
Related Lists list, click
Operations, and then in the list view, in the top left corner, click
Link (
).
5. In the
Link Related Operations list, click the validator you configured for custom validation, for example,
Relationship Validator, and then in the top left corner, click
Link Related Records (
).
6. On the
Developer Tools (
) launchpad menu, click
Operations, and then in the list view, click the validator you created for custom validation, for example,
Relationship Validator.
7. On the record page, on the
Sources tab, click
Create (
), and then in the
Create New Source dialog box, in the
Name and
Application fields, enter and save values.
8. Create Groovy source code to implement the desired custom validation logic, and then in the Sources tab, click the newly created Source record and update the code.
For more information: