Show Sharepoint Documents in Subgrid of main form RRS feed

  • Question

  • Hi,

    Is there a way to add a subgrid that shows the documents uploaded to sharepoint on main CRM form.

    It should show me the actual documents, not the document location records.

    I am using CRM 2016.

    Any help on this is appreciated.


    Kruthi Hegde

    Tuesday, May 3, 2016 9:32 AM

All replies

  • You want to show the SharePoint related documents in an Iframe on Contact entity.


    There is a below unsupported way in which it can be achieved:


    You may use the below line of code to set the Iframe url to display the subgrid in iframe:


    Xrm.Page.getControl("IFRAME_Documents").setSrc(Xrm.Page.context.getClientUrl() + "/userdefined/areas.aspx?formid=" + CurrentFormId + "&inlineEdit=1&navItemName=Documents&oId=%7b" + recordId + "%7d&oType=" + oTypeCode + "&pagemode=iframe&rof=true&security=852023&tabSet=areaSPDocuments&theme=Outlook15White");



    IFRAME_Documents” is the Iframe name.


    CurrentFormId= Is the Current selected form id which you can get using “Xrm.Page.ui.formSelector.getCurrentItem().getId().replace("{", "").replace("}", "");”


    recordId” = Record’s GUID


    oTypeCode” = Entity Type Code which you can get using “Xrm.Page.context.getQueryStringParameters().etc;


    Then the documents will be displayed in IFRAME on Contact form as you can see below:

    Note: If you are using “Print Preview” button for the Contact record then there is an issue which occurs. It just displays the data in the grid and not the Contact data in the Print Preview form. 



    Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    • Proposed as answer by Andrew Wolfe Wednesday, February 1, 2017 11:29 AM
    Thursday, May 5, 2016 9:49 AM
  • hi

    Thanks for this work around.

    I have applied this code in CRM 2016 Online for case entity and was working perfect.

    From 14/02/2017 on wards i am getting error as below.


    An error has occurred.

    Try this action again. If the problem continues, check the Microsoft Dynamics CRM Community for solutions or contact your organization's Microsoft Dynamics CRM Administrator. Finally, you can contact Microsoft Support.

     Did Microsoft apply any changes in online versions , which caused this issue ?



    Friday, February 17, 2017 9:32 AM
  • Any chance you could make a video guide for codeless configurators?
    Wednesday, December 6, 2017 10:52 AM