How to Add SharePoint Document Files Tab to a Dynamics 365 Custom 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.

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 and publish
"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 on:
Microsoft Dynamics 365 2020 release wave 2 enabled
Server version: 9.2.21014.00140
Client version: 1.4.2204-2101.4

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.

Leave a Reply

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

WordPress.com Logo

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

Google photo

You are commenting using your Google 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