CRM Software Logo

A panel of Microsoft Dynamics CRM experts provide reviews and opinions to aid professionals with the CRM selection process.

 
 
Hitachi Solutions America Bloggers

Entity Relationship Diagrams in Microsoft Dynamics CRM 2011

Email | Print

Visual representation of entity relationships and metadata can be very useful in a CRM project. Thankfully, Microsoft has provided pre-built Entity Relationship Diagrams (ERD) for eleven of the most important out of the box entities in CRM2011. They are available here in Visio format.

You can also create ERDs for custom entities. The generator is buried deep inside of the SDK (…\sdk\samplecode\cs\metadata\diagram ). You will need Visual Studio and Visio 2010 to run the document generator.

1. First, open the above file path and open the file MetadataDiagram.csproj in Visual Studio.
2. Next, from the toolbar, click the Build Solution icon.meta1

3. You could run the program now. However, it will map all of the entities, their attributes and their relationship to each other. This will take a very long time, but more importantly, it's complexity may render it useless to most people. What I have found useful it to map one entity at a time, or at the most two or three.

4. In order to draw one or more specific entities, click the debug tab, then enter the logical name in the Command line argument box. You can enter as many entities as you would like to map here. For instance, if you would like to map accounts, then simply enter "account". If you would like to map an custom entity then enter "new_entityname". If you would like to map the relationships between you custom entity and accounts, then enter "account new_entityname". Remember, that will map your new entity, accounts, and the relationships between them. If you want a map for accounts and another map for your custom entity, you will need to run the program twice.

5. To run the program, hit the Start Debugging button in the toolbar.

6. This will bring up a command prompt. It will ask for a CRM server and a port. It is very simply orgname.domainname.net (no https:, etc.) Then you enter your username and password just as you would if you were logging into CRM as a user.CP1

7. The program will run (usually a few minutes) and create a Visio document in the path: (..sdk\samplecode\cs\metadata\diagram\bin\Debug ). The name of the file will be simply "account.vsd". It is important to note that if you use the program to create another account diagram, and there is already a file called "account.vsd" in the Debug file, the command prompt will issue an error and the document will not be created. It is a good best practice to move your finished files from the Debug folder as you finish them.

A sample of the output is below. This is for the entity 'sharepointsite' in ootb CRM.

sp1
Post by: Brad Koontz, Customer Effective

Ask This Expert a Question / Leave a Comment