Microsoft Dynamics 365 Custom Table (Custom Entity) supports Document Management with SharePoint. The Main Form on the Custom Table (Custom Entity) however DOES NOT have the Files tab available by default.
WORK for Out of the Box Tables too. The same setup also applies to adding the Files tab to Main Forms (if missing and not present by default) of out of the box Dynamics 365 tables (entities) that are enabled for Document Management.
Note: We will need to use the Microsoft Power Apps Form Designer to do this since the Dynamics 365 Legacy / Classic Solution Explorer DOES NOT have the option to setup the related Documents subgrid under the Files tab.
Here is how to add a SharePoint Document “Files” tab to a Document Management enabled Dynamics 365 Table (Entity).
Part 1 – Create the Files tab and add the Related Documents Subgrid
- Open Power Apps > select the Dynamics 365 environment > open the Solution containing the custom entity main form to add the Files tab to
Note: For this example – we will use a custom table (entity) called “Company”
- From the opened Solution > Open the custom entity > Open the Main Form to add the Files tab
Note: For this example – we will use the main form called “Information”

- Add a 1 column tab and label it “Files” to the main form
- Select this new tab and click to focus on the Section
- Hide the Section label in this new “Files” tab


- Add a Subgrid component to this new Files tab
- Click on the “Show related records” and select the “Documents (Regarding)” for Table
- The Default view is defaulted to “All SharePoint Document” and NOT editable from Power Apps Form Designer at this time. We will set this to “Document Associated Grid” default view via Customization XML at a later step – see Part 2 below
Note: “Document Associated Grid” is the default view behavior found in out of the box Files tab and related Documents view

- Check the “Hide label” option for the Subgrid control
- Check the “Allow users to change view” option
- Check the “Show all views” option

- Save and Publish the change
- The Files tab is now functional except that it defaults to the “All SharePoint Document” and will NOT display the Document Location on the upper left corner below the view name. If this is OK – you can stop here. However, if you like to set the default view to “Document Associated Grid” – proceed to the next step – Part 2 Modify the Customization XML

Part 2 – Modifying the Customization XML to set Files tab default view to “Document Associated Grid“
Note: Need to be extra careful when editing the Customization XML since it will be via UNmanaged Solution – changes are final. Be sure to test it out in a test environment first.
- Open Power Apps > select the Dynamics 365 environment > Create a NEW Solution to contain only the updated main form component from Part 1 above AND NOTHING ELSE
- Add the custom Table to this NEW Solution from above


- Click on Select components and ONLY select the Main Form component with the Files tab from above
- DO NOT include all components
- DO NOT include table metadata



- Export this solution as Unmanaged solution


- Update the customizations.xml from the downloaded Unmanaged solution zip file
- Search for the Subgrid control label name in the customizations.xml. Example above is labeled “New SG control 1614755864750“
- Replace the <ViewId> value A5B008AC-07D9-4554-8509-2C05767BFF51 with 0016F9F3-41CC-4276-9D11-04308D15858D. THIS IS THE ONLY CHANGE
- Import the Unmanaged solution zip file
- Publish the table/entity

"All SharePoint Document" view GUID (replace this value in the UNManaged Solution's Customizaton XML):
<ViewId>{A5B008AC-07D9-4554-8509-2C05767BFF51}</ViewId>
TO THIS "Document Associated Grid" view GUID:
<ViewId>{0016F9F3-41CC-4276-9D11-04308D15858D}</ViewId>

This was tested OK on:
2021 release wave 2 enabled
Server version: 9.2.21112.00141
Client version: 1.4.3618-2111.2

Contact me if you need some Microsoft Dynamics 365 CRM Sales Customer Engagement assistance.
Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley
Brilliant! Thank you so much! Your instructions were super easy to follow too!
hi , I have 2 document subgrid.(SubGridA and SubGridB). I want to show Folder 1 library for SubGridA.
SubGridB will be seen all associated documents.
I would try/test the following: setup a new public view for subgridA on “Sharepoint Document” table/entity. Update the location field filter on this new public view to match subgridA. Default to this view in the subgridA properties.
Hello Frank, brilliant post, it was very useful for me.
One question, I’m finding that I cannot click in to the folders I create via the Document Associated Grid view. Is that the native functionality or do I have an issue on my implementation?
Hi Steve. Should work OK. I’d tested drilling down into the folders created from the Document Subgrid and showed OK on the SharePoint side also.
Thank you Frank for checking this. Appreciate it. Keep up the good work.
The fix to this was rudimentary – I had removed the ‘Path’ column from the Document Associated Grid view. This prevented click through of folders via the model-driven app.