Customize entity metadata
Applies To: Dynamics CRM 2016, Dynamics CRM Online
Entities are defined by metadata. By defining or changing the entity metadata, you can control the capabilities of an entity. To view the metadata for your organization, use the metadata browser provided in the SDK package. Download the Microsoft Dynamics CRM SDK package. More information: Browse the metadata for your organization
This topic is about how to work with entities programmatically. See TechNet: Create and edit entities for information about working with entities in the application.
The following table lists the options that are available when you create a custom entity. You can only set these properties when you create a custom entity.
Create as custom activity
There are two types of names, and both must have a customization prefix:
Use the EntityMetadata.OwnershipType property to set this. Use the OwnershipTypes enumeration to set the type of entity ownership. The only valid values for custom entities are OrgOwned or UserOwned. For more information, see 8597998f-764f-4c73-b63d-9f5e02c78061#EntityOwnership.
Use CreateEntityRequest.PrimaryAttribute to set this. Each entity has a StringAttributeMetadata attribute that uses StringFormat.Text as the primary attribute. The value of this attribute is what is shown in a lookup for any related entities. Therefore, the value of the field should represent a name for the entity record.
The following table lists entity capabilities. You can set these capabilities when you create an entity or you can enable them later. Once enabled, these capabilities cannot be disabled.
Business Process flows
Use the CreateEntityRequest or UpdateEntityRequest.HasNotes property to create an entity relationship with the Annotation entity and enable the inclusion of a Notes area in the entity form. By including Notes, you can also add attachments to records.
Use the CreateEntityRequest or UpdateEntityRequest.HasActivities property to create an entity relationship with the ActivityPointer entity so that all the activity type entities can be associated with this entity.
Use the EntityMetadata.IsValidForQueue property to add support for queues. When you enable this option, you can also set the EntityMetadata.AutoRouteToOwnerQueue property to automatically move records to the owner’s default queue when a record of this type is created or assigned.
The following table lists entity properties that you can edit. Unless a managed property disallows these options, you can update them at any time.
Allow Quick Create
If an entity has an image attribute you can enable or disable displaying that image in the application using PrimaryImageAttribute. For more information see 8597998f-764f-4c73-b63d-9f5e02c78061#BKMK_EntityImages.
Change display text
The managed property EntityMetadata.IsRenameable prevents the display name from being changed in the application. You can still programmatically change the labels by updating the EntityMetadata.DisplayName and EntityMetadata.DisplayCollectionName properties.
Edit the entity Description
The managed property EntityMetadata.IsRenameable prevents the entity description from being changed in the application. You can still programmatically change the labels by updating the EntityMetadata.Description property.
Enable for use while offline
Enable the Outlook Reading Pane
To enable or disable the ability of Microsoft Dynamics CRM for Outlook users to view data for this entity, use the Microsoft Outlook reading pane. You must set this property in the application.
Enable Mail Merge
Enable Duplicate Detection
Enable SharePoint Integration
Enable CRM for phones
CRM for tablets
Change areas that display the entity
You can control where entity grids appear in the application Navigation Pane. This is controlled by the SiteMap. For more information, see Edit the site map.
Add or Remove Attributes
As long as the managed property EntityMetadata.CanCreateAttributes allows for creating attributes, you can use the CreateAttributeRequest message to add attributes. For more information, see Customize entity attribute metadata.
Add or Remove Views
Add or Remove Charts
As long as the managed property EntityMetadata.CanCreateCharts allows for creating charts and the EntityMetadata.IsEnabledForCharts entity property is true, you can use SavedQueryVisualization to create charts for an entity. For more information, see View data with visualizations (charts).
Add or Remove Entity Relationships
There are several managed properties that control the types of entity relationships that you can create for an entity. For more information, see Customize entity relationship metadata.
You can change the icons used for custom entities. For more information, see Modify the icons for an entity.
Use custom Help
Can Change Hierarchical Relationship
The following table lists the messages that you can use to create, retrieve, update and delete entity metadata.
Creates a custom entity.
Deletes a custom entity.
Retrieves the metadata for all entities.
Retrieves the metadata for an entity.
Updates the metadata for an entity.
Used together with objects in the Microsoft.Xrm.Sdk.Metadata.Query namespace to create a query to efficiently retrieve and detect changes to specific metadata. More information:Retrieve and detect changes to metadata.
Custom entities support the same base messages as system entities. The set of messages available depends on whether the custom entity is user-owned or organization owned. For more information, see 8597998f-764f-4c73-b63d-9f5e02c78061#ActionsOnEntityRecords.
Use the Organization service with CRM metadata
Introduction to entities in Microsoft Dynamics CRM
Browse the metadata for your organization
Customize entity attribute metadata
Customize entity relationship metadata
Detect duplicate data
Enable document management for entities
Configure entities and attributes for auditing
Edit the site map
View data with visualizations (charts)
Which entities are customizable?
Create a custom entity
Retrieve, update, and delete entities
Create and update an entity than can be emailed
Create a custom activity entity
Modify the icons for an entity
Modify the messages for an entity
Sample: Create and update entity metadata
Sample: Create a custom activity entity
Sample: Create and update an emailable entity
Sample: Dump entity metadata to a file
Sample: Dump entity privilege information to a file
Microsoft Dynamics CRM 2016 and CRM Online
© 2016 Microsoft. All rights reserved. Copyright