How to Add SharePoint Document Files Tab to a Dynamics 365 Custom or Out of the Box Table (Entity) Main Form

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):


TO THIS "Document Associated Grid" view GUID:

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

About Frank Lee

Microsoft Dynamics 365 CRM/xRM consultant in San Francisco, USA.  Awarded the Microsoft MVP (Dynamics 365/CRM) 12 consecutive years from 2006 to 2018. Actively involved with Microsoft Dynamics CRM implementations since Microsoft CRM v1.0 beta (2002). Super passionate about everything CRM, especially in the areas of Cloud Computing, A.I., Digital Transformation and Automation.
This entry was posted in Customization, Document Management, Dynamics 365, Power Apps, SharePoint Integration, Unified Interface and tagged , , , , , , , , , , , , , , , , . Bookmark the permalink.

7 Responses to How to Add SharePoint Document Files Tab to a Dynamics 365 Custom or Out of the Box Table (Entity) Main Form

  1. Susan Mertens says:

    Brilliant! Thank you so much! Your instructions were super easy to follow too!

  2. 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.

    • Frank Lee says:

      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.

  3. Steve W says:

    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?

    • Frank Lee says:

      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.

    • Steve W says:

      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.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s