Featured image of post ERD Visio Builder - XrmToolBox addon

ERD Visio Builder - XrmToolBox addon

As with my Org Settings tool, creating Visio diagrams to represent and document your entities and relationships in Dynamics has long been on my list to find a better solution than making them yourself.

There is already a couple of Entity visualisers in the XrmToolBox suite, but non that output to Visio.

The project is available in XrmToolBox, source here and I am indebted to Saveen Reddy for his code to automate the creation of Visio diagrams, here. Also, Jonas Rappen, again, supported me. We have discussed bring Visio to his UML Diagram Generator and merge the two. When I say merge, I mean I piggyback on all his more excellent work with the bit I did.

TL;DR

I created a tool to allow users to document their entities and relationships within the Common Data Service producing Microsoft Visio documents.

Update 9/2/23

It seems that it takes me a while to update tools (well, significant change) and I am writing 18 months after the last update to tell you of a new change.

This one brings 2 new features, brought about by Dani Kahil. He did a great article on how you can make use of my tool to improve the requirements & design process of your app.

Making “Entity Relationship Diagrams (ERD)” easier to understand – Mastering requirements, ideation and design for Microsoft Business Applications (danikahil.com)

To support some of the change Dani has asked for, it was necessary to update my code to the same way the Flow to Visio – XrmToolBox Addon works and use the new Visio XML document format. This is now visible as an option under

In the article, Dani creates areas around his tables to make the ERD clearer to read, I have added that as containers.

In the top of the app is the Containers tab, where you can establish a name & colour (hex only for now). Once done, the container can be selected in the list of tables you have added.

When you create the Visio, Containers now appear with the selected tables inside of them.

Comments & criticism always welcome!

Update 1/7/21

Wow, looking at this blog post I realise how long this tool has been around! It was in desperate need of a re-vamp, learning from my experiences over the last year. I was pushed to deliver asks from the community (well, nags from MCJ) I have added Columns to the output as well as tidying up the interface to work more like you would expect.

I also realise the Save Config / Export and Import are not documented. This was done back in February, so my bad for not documenting it.

Simply put, Save a configuration (your current selections) with the Save Config button. You can also Export a settting as an XML file, which can then be brought into your tool with the import button.

I have updated the content of the walkthrough to match the new version.

Update 29/7/20

I have added a few things to the application. Firstly, swapped the Entity selection to separate buttons and added some icons. I have also added a search at the top. There is a Select All toggle as well, that was a feature request, can you believe! (just excited people are using it really!)

Many-To-Many relationships are now available. I have also added Custom Properties to document the relationships. In Visio, under View/Task Panes should be Shape Data. Enable this to display a little panel. In it are details of what is linking up the lines, showing you parent/child/field/relationship date for one-to-many and many-to-one and the entities and the navigation for many-to-many.

I have also added App Insights, for my own gratification, which is monitoring the number of Visio diagrams created as well as the number of entities that were documented for my little tool. This can be seen in the Tools - Statistics page.

Finally, I have prefixed each of the fields with Primary Key (PK) or Foreign Key (FK) notation.

Walkthrough of the Application

The app is pretty basic looking to start, I wanted to get the core ability out there without bells and whistles, like any good Agile project. To get started, you need to load the entities you are interested in. Choosing From Solution allows you to choose one or more solutions to retrieve Entities from.

If you choose All Entities, the list is populated with all the entities in your environment.

In the left Tables grid, you can then choose one or more tables. The ones you choose are highlighted in Selected Tables. As you select a table, the right grid will update to show you the Columns for that table. As you select columns, the Selected Tables grid is updated to indicate which columns will also be added to your ERD.

Top right of this window is where you decide which relationships to document. Only Between Selected Entities does what it says on the tin, it will only document the relationships between the entities you have selected.

Above that is a selection on the number of levels you want to go down. Only applies when you select One-To-Many or Many-To-One or Many-To-Many selections. This means, if you select 2 levels, it will document the table selected, any child tables and any child tables of those child tables. Be careful here, as you can get lots of tables and lots of relationships!

There is also a toggle switch at the top of the toolbar, which will exclude a list of entities that are associated with an entity by default. There are relationships for the created user and modified user for example, which are probably not relevant to your documentation.

When you select Create Visio, with a file chosen, a VDX file will be created. This is the XML format of the previous version, superseded by VSDX. As VSDX is also XML, there are components available that can create these directly, but the library Saveen created wraps up all the stuff I need in a package I can understand.

Show and Tell

Saving Configs

Once you are happy with what you have got, and to save you re-doing all those clicks, you can Save Config. Hit the button to be prompted for a name.

Give it a name to create a new map or update an existing map. This will save the map to your XrmToolBox settings and be there when you re-open the application.

Also, you can select Export. Choose one of your configurations and this will create an XML file in the given place for you to pass to whoever you want!

Import will prompt for an XML file and add it into your current configs. Simples!

Next steps

My immediate priority is to add a better interface, to allow for more detail selection of the properties the code generates,. I also need to display Many-To-Many relationships effectively. Also, allow users to select all the attributes and maybe generate them more like the UML versions Jonas has made. Done!

Please let me know of your suggestions too, particularly bugs, and I will do my best to correct them. Create an issue on the GitHub page here or pull the code and help me out!

comments powered by Disqus
My views, nothing to do with anyone else
Built with Hugo
Theme Stack designed by Jimmy