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
          Create a Relationship to a Custom Metadata Type or Entity Definition

          Create a Relationship to a Custom Metadata Type or Entity Definition

          Create direct relationships to a custom metadata type or entity definition.

          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

          User Permissions Needed
          To create custom metadata relationships: Customize Application
          1. From the detail page of your custom metadata type, click New under Custom Fields.
          2. For the field type, select Metadata Relationship.
          3. Select either:
            • Another custom metadata type that you want to be the child of the active custom metadata type.
            • Entity Definition (Represents the metadata of a standard or custom object)

            Public custom metadata types can’t be related to protected custom metadata types.

          4. Create a record for storing the metadata relationship.
            • If the Required box is checked, you can’t create a record for the parent types unless the child type has at least one record. A link to the records of the child custom metadata types is available from the parent custom metadata types record.

            • For entity definitions, select the standard or custom object that represents the entity definition.

          You can now query your custom metadata type or entity definition using Apex.

           
          Loading
          Salesforce Help | Article