How to add a SharePoint Document sub-grid to any Form in Dynamics 365

Isaac Stephens, 07 October 2020

A limitation with Dynamics 365 SharePoint integration was the fact you had to go related and click on the document option. This was made slightly better when Microsoft added a Files Tab to the Accounts, Contacts, Leads, and Opportunity Forms. This still left many of entities, including Cases and Custom Entities, having to use the old method of going to the related tab. However, there is a way to add a similar view onto any entity with Document Management turned on and this is by using the Unified Interface form editor.

If you still do all your customization within CRM you are probably using the old Web Client form editor which does not allow you to add this sub-grid, however if you go over to Power Apps and use the new solution viewer there it will allow you to use the Unified Interface Form Editor. image

Once you have gone to your solution go to the entity and open the form you want to add it to, it will open the new editor for you. After it has loaded add a sub-grid to the form and tick Show Related Records and choose ‘Documents (Regarding)’. image

This will add the sub-grid in and will most lost likely display a warning message in the editor, however this is okay as when you open the form with a record it will display the available documents.image

There are some limitations to this sub-grid, it does not allow you to see folders. This means that instead of having a folder structure it will just show all Documents even ones within folders. Below shows 2 documents, one is in the root folder (C89608) and the other is within ‘Test 2’ in the root folder but they are displayed without that structure. image

Whereas if we were in the Related tab looking at the Documents we see it in a folder structure view and see ‘Test 2’image

This does mean that uploading files through this view are going to be uploaded to the root folder. However, you can just click See Associated Records and it will take you to the OOTB Document Tab that has the folder structure.image

So, although this may not be a complete solution to having the documents display anywhere you like, it is good for basic use cases where folder structure is not required.