You are here:
Custom Metadata Relationship Considerations
Before you start using custom metadata relationships, keep these considerations in mind.
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 query custom metadata relationships the same way you query normal relationships.
- You need the Customize Application permission to view custom metadata type records.
- You can’t relate public custom metadata types to protected custom metadata types. Protected custom metadata types can be related to public custom metadata types.
- If you use SOQL to query a custom metadata type, the results include only those records that reference objects you have permission to access. However, a similar query using Setup or the Metadata API results in all relevant records, including records that reference objects you cannot access.
- You can’t install a package that contains custom metadata type records whose relationship fields reference objects that your org can’t access. The installation error message includes the list of objects to which you need access.
- You can install a package that contains custom objects for which you don’t have an active license. However, those records do not appear in SOQL queries for any users until you acquire the license to the objects.
- If you don’t have permission to view an object in Setup, relationship field values that reference that object appear as plain text rather than links.
- To set the EntityDefinition object as a new value on a relationship field, your org must be able to access the object. However, if your org can’t access to relationship field objects for existing records, you can still edit the record and change other field values. Your org can lack access if, for example, the record is part of a package for which you don’t have an active license.
- A relationship field with the EntityDefinition domain can be a custom or standard object. The
following rules apply to the metadata relationship field type. The entity:
- Must be publicly exposed
- Can be queried using the API
- Supports Apex triggers
- Is customizable
- Supports layouts
- Is not part of a union, such as a task, activity, event, holiday
- Is not a setup entity, such as a permission set or a user
- Unsupported values for a relationship field with the EntityDefinition domain are:
- A type of activity, such as a Task or Event
- A Trialforce object, such as a SignupRequest
- sObjects:
- FieldPermissions
- Group
- GroupMember
- ObjectPermissions
- PermissionSet
- PermissionSetAssignment
- QueueSObject
- ObjectTerritory2AssignmentRule
- ObjectTerritory2AssignmentRuleItem
- RuleTerritory2Association
- SetupEntityAccess
- Territory2
- Territory2Model
- UserTerritory2Association
- User
- UserRole
- UserTerritory
- Territory
Did this article solve your issue?
Let us know so we can improve!

