|
| 1 | +--- |
| 2 | +title: "Add the Documents tab to the main form for an entity | MicrosoftDocs" |
| 3 | +description: "Learn how to add the Documents tab to the main form for an entity" |
| 4 | +s.custom: |
| 5 | +ms.date: 09/05/2019 |
| 6 | +ms.reviewer: |
| 7 | +ms.service: crm-online |
| 8 | +ms.suite: |
| 9 | +ms.tgt_pltfrm: |
| 10 | +ms.topic: article |
| 11 | +applies_to: |
| 12 | + - Dynamics 365 for Customer Engagement (online) |
| 13 | + - Dynamics 365 for Customer Engagement Version 9.x |
| 14 | +author: Mattp123 |
| 15 | +ms.assetid: |
| 16 | +caps.latest.revision: |
| 17 | +ms.author: matp |
| 18 | +manager: kvivek |
| 19 | +search.audienceType: |
| 20 | + - customizer |
| 21 | +search.app: |
| 22 | + - D365CE |
| 23 | +--- |
| 24 | +# Add the SharePoint documents tab to the main form for an entity |
| 25 | +[!INCLUDE [cc-beta-prerelease-disclaimer](../../includes/cc-beta-prerelease-disclaimer.md)] |
| 26 | + |
| 27 | +Adding a tab on an entity main form to display SharePoint documents helps users discover and use the SharePoint integration features that are available in a model-driven app. |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +> [!IMPORTANT] |
| 32 | +> To use this feature you must enable document management. More information: [Manage your documents using SharePoint](/dynamics365/customer-engagement/admin/manage-documents-using-sharepoint) |
| 33 | +
|
| 34 | +## Add the documents tab in the FormXML |
| 35 | +1. Create a new solution. Sign-in to PowerApps and go to **Solutions**, select **New solution** and then enter the required and optional information. More information: [Create a solution](../common-data-service/create-solution.md) |
| 36 | +2. Add the entity to the solution where you want to add the documents tab on the main form. All standard and custom entities are supported. More information: [Add an existing component to a solution](/powerapps/maker/common-data-service/use-solution-explorer#add-an-existing-component-to-a-solution) |
| 37 | +3. Include the form for the entity in the solution, such as the main form for the account entity. Next to the entity, select **...**, and then select **Edit**. Select the **Forms** tab. If the form you want is missing, add it. |
| 38 | + |
| 39 | +4. Add a one-column tab to the main form. To do this, in the form designer select an area on the form canvas, select **Add Component**, and then select **1 Column Tab**. |
| 40 | +  |
| 41 | + |
| 42 | +5. In the form designer select the **New Tab** on the form designer canvas, select **Add Field**, and add a field such as *Address 1: City* from the left pane. You can use any text or numeric field for the tab. |
| 43 | +  |
| 44 | +6. Rename the tab label. To do this, select **New Tab**, and in the right properties pane replace **New Tab** with something more descriptive, such as *Files*. |
| 45 | +7. Select **Save**, select **Publish**, and then close the form designer. |
| 46 | +8. From the PowerApps maker home page, select **Solutions**, select the solution, and the select **Export** to export the solution as an unmanaged solution. More information: [Export solutions](../common-data-service/import-update-export-solutions.md#export-solutions) |
| 47 | +9. Extract the solution and open the customization.xml file with an XML or text editor. |
| 48 | +10. In the customization.xml search for **label description="Files"** (or whatever you named the tab label in the previous step). |
| 49 | +11. Scroll down to the control id="*field name*" element, such as **control id="address1_city"** and replace the entire element with the [XML sample](#xml-sample-for-adding-the-documents-tab-to-a-form) in this topic. |
| 50 | + |
| 51 | + > [!div class="mx-imgBorder"] |
| 52 | + >  |
| 53 | +
|
| 54 | +12. Make these modifications to the XML sample. |
| 55 | + |
| 56 | + a. Locate the **RelationshipName** element and replace it with the schema name that appears as *entityLogicalName*_SharePointDocument. For example, for the accounts entity the schema name for the relationship is Account_SharePointDocument, which is the schema name for the XML sample in this topic. To find the name for a different entity, go to **Settings** > **Customizations** > **Customize the System** > **Entities** > select the entity > select **1:N Relationships**. Locate the **Related Entity** of type **SharePointDocument**. |
| 57 | + |
| 58 | +  |
| 59 | + |
| 60 | + b. Create a globally unique identifier (guid) and replace the existing **uniqueid** guid located in the **control** element you pasted in the previous step while preserving the curly braces {}. |
| 61 | +  |
| 62 | + c. Save your changes to customizations.xml. |
| 63 | +13. Open the solution.xml file and increment the **Version** element value. For example, from *1.1.0.0* to *1.2.0.0*. |
| 64 | +14. Package all solution files into a compressed (zipped) folder and import in to your environment. If you receive an error that you must delete the previous solution, do so. More information: [Import, update, and upgrade a solution](../common-data-service/import-update-export-solutions.md) |
| 65 | + |
| 66 | +## XML sample for adding the documents tab to a form |
| 67 | +```xml |
| 68 | + <control id="DocumentSubGrid" classid="{E7A81278-8635-4d9e-8D4D-59480B391C5B}" indicationOfSubgrid="true" uniqueid="{9cd66b5c-8b7a-6433-c5a5-46a7245dd534}"> |
| 69 | + <parameters> |
| 70 | + <ViewId>{0016F9F3-41CC-4276-9D11-04308D15858D}</ViewId> |
| 71 | + <IsUserView>false</IsUserView> |
| 72 | + <RelationshipName>Account_SharepointDocument</RelationshipName> |
| 73 | + <TargetEntityType>sharepointdocument</TargetEntityType> |
| 74 | + <AutoExpand>Fixed</AutoExpand> |
| 75 | + <EnableQuickFind>false</EnableQuickFind> |
| 76 | + <EnableViewPicker>true</EnableViewPicker> |
| 77 | + <ViewIds /> |
| 78 | + <EnableJumpBar>false</EnableJumpBar> |
| 79 | + <ChartGridMode>Grid</ChartGridMode> |
| 80 | + <VisualizationId /> |
| 81 | + <IsUserChart>false</IsUserChart> |
| 82 | + <EnableChartPicker>false</EnableChartPicker> |
| 83 | + <RecordsPerPage>10</RecordsPerPage> |
| 84 | + <HeaderColorCode>#F3F3F3</HeaderColorCode> |
| 85 | + </parameters> |
| 86 | + </control> |
| 87 | +``` |
| 88 | + |
| 89 | +### See also |
| 90 | +[Manage your documents using SharePoint](/dynamics365/customer-engagement/admin/manage-documents-using-sharepoint) |
0 commit comments