Sunday, 15 March 2020

Show SharePoint Document Grid on the Main Form Microsoft Dynamics 365 D365 MSCRM

Show SharePoint Document Grid on the Main Form Microsoft Dynamics 365 D365 MSCRM using IFrame.



function SetDocumentFrame() {

    //You can see what the url should be by navigating to the 'Documents' area under related records, viewing the pageSoure
    //and looking for 'areaSPDocuments'. The formid appears to be nothing more than a random guid value and not tied to anything 
    //specific in your org. 

    //Use: Make sure Document Management is enabled for the entity (helps to turn on automatic folder creation)
    //     Add a web resource with this code to the form 
    //     Execute this function during the form's OnLoad event

    var url = Xrm.Page.context.getClientUrl() +
        "/userdefined/areas.aspx?formid=ab44efca-df12-432e-a74a-83de61c3f3e9&inlineEdit=1&navItemName=Documents&oId=%7b" +
        Xrm.Page.data.entity.getId().replace("{", "").replace("}", "") + "%7d&oType=" +
        Xrm.Page.context.getQueryStringParameters().etc + 
        "&pagemode=iframe&rof=true&security=852023&tabSet=areaSPDocuments&theme=Outlook15White";

    Xrm.Page.getControl("IFRAME_???").setSrc(url); //Replace IFRAME_??? with actual IFRAME name
}

No comments:

Post a Comment