People have been asking “Where is the metadata browser in Microsoft Dynamics CRM 2011?”. For those of you who don’t know what the original metadata browser was, see Metadata Browser. The original metadata browser was removed from CRM 2011.
I’m happy to announce that the latest update to the Microsoft Dynamics 2011 Software Development Kit (SDK) includes a managed solution that replaces and I hope improves upon the original metadata browser. To get the new metadata browser you must:
1. Download the SDK (here).
2. Install the SDK.
3. Import the MetadataBrowser_1_0_0_1_managed.zip located in the SDK at SDK\Tools\MetadataBrowser\.
After you install the Entity Metadata Browser it will appear in the Customizations area.
The initial view is just a list of entities with a detail list of the properties for the selected entity. There are capabilities to filter the list of entities. You can choose to filter on the following properties:
- Custom entity
- Customizable entity
- Intersect entity (an entity used in Many-To-Many relationships)
- Type of entity ownership
You can also do a text search that looks for matches in the following:
- SchemaName (and by extension Logical Name)
- Display Name (if the entity has one)
- Object Type Code
For the Properties grid, you can filter the list of property names. This properties grid shows only the simple values for the properties. In reality, many of these properties are objects with many more additional properties. For the sake of simplicity only the most useful property value is shown here.
To view all the details for an entity, you need to right-click the SchemaName value and choose View Details from a context menu. For those entities that appear in the default solution, you also have the ability to select Edit which will open the entity definition in the default solution.
When you view the details for an entity, a new window opens and you can navigate to each of the more complex properties.
The Properties view allows you to drill down and see all the details for the complex properties.
If you expand a Label property like DisplayName, you can see all the details that a Label property has:
The Attributes view shows all the attributes and you can filter by:
- Custom attributes
- Customizable attributes
- Type of Attribute
- Type of entity ownership
- Text match on SchemaName, DisplayName and MetadataId
Properties for the selected attribute appear on detail grid.
For OptionSet (Picklist) attributes you can view all the options and expand down to view all the properties for the option set.
Simple view of the Account.AccountCategoryCode.OptionSet property:
Expanded view of all the details:
Similar details are available for entity relationships and privileges.
Most property names and simple values can be copied to your clipboard by right-clicking and choosing the Copy option from a context menu. At this point, complex property values do not support being copied to the clipboard.
Although it is included in the SDK, it isn’t a sample. We aren’t publishing the source code since the vast majority of it is just rendering the UI and that really has nothing to do with Microsoft CRM. The Metadata browser is done using HTML and JScript Web resources. It doesn’t use JQuery or any other supporting libraries.
The SDK.Metadata.js sample library from the SDK is used to retrieve data. A much simpler sample and the full code for that library is published in the SDK at Sample: Retrieve Entity Metadata using JScript.
I hope that this solution will help you explore, understand and make productive use of the Microsoft CRM 2011 entity metadata.