Loading
Enhance Salesforce with Code
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Custom Metadata Type Fields and Validation Rules

          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.

          Required Editions

          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 - Checkmark.
          Developer Name Checkmark. Checkmark.
          Namespace Prefix Checkmark. Checkmark.
          Qualified API Name Checkmark. Checkmark.

          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.

           
          Loading
          Salesforce Help | Article