You are here:
Custom Metadata Type Fields and Validation Rules
You can use validation rules with fields in custom metadata types, including relationship fields. Keep these tips in mind as you do.

Use more general search terms.
Select fewer filters to broaden your search.
You are here:
You can use validation rules with fields in custom metadata types, including relationship fields. Keep these tips in mind as you do.
| Available in: Salesforce Classic and Lightning Experience |
Available in: Enterprise, Performance, Unlimited, and Developer Editions You can create, edit, and delete custom metadata type records from installed packages in: Group and Professional Editions |
You can use validation rules within custom metadata types just as you would for non-custom types. If you use relationship fields, you can use validation between two custom metadata types. You can also use them on the following targets:
| Field | Entity Definition | Field Definition |
|---|---|---|
| Data Type | - |
|
| Developer Name |
|
|
| Namespace Prefix |
|
|
| Qualified API Name |
|
|
For example, let’s say you create a custom metadata type named Employee Records. The type
contains the relationship field Feedback__c, which
has an entity relationship. You can create a rule that traverses the relationship to
check if the related object or field is a custom object or
field.
EQUALS(RIGHT(Feedback__r.QualifiedApiName, 3), '__c')The syntax is like any other validation rule, but instead of choosing a field, you select the entity relationship field that you created.

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.