web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM 2015 SharePoint Integration 2013 for Document Management

(0) ShareShare
ReportReport
Posted on by 2,665

Hi,

I have integrated sharepoint with CRM for document management. So, users can upload documents for a case from document entity. 'Case' entity has 1 to many relationship with 'Documents' entity.
Now, I would like to add an extension to it by having something on the case form itself.. so that users can access thier documents stored in sharepoint from case form itself directly.. instead of going into each document form to access the documents they uploaded.
I am thinking of setting up an iframe on the case form and show the documents links to the sharepoint in it. But I am not sure if this can be done or not! If it can be done.. how can I get the url for each document specific to that case?

Thanks for any help.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    SharePoint will be storing all the documents related to a case using the GUID of the case. You should be able to fetch all related documents using the case GUID.

  • Mahendar Pal Profile Picture
    45,095 on at
  • Inogic Profile Picture
    715 on at

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

    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");

    Where:

    “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;”

  • crmprogrammer2013 Profile Picture
    2,665 on at

    Hi,

    Thank you guys..

    Those are helpful but I am getting a "Object reference not set to an instance of an object" error.

    This is how I am setting the iframe url:

    iframeObject.setSrc(Xrm.Page.context.getClientUrl() +"/userdefined/areas.aspx?oId=" + recordId + "&oType=" + objectType + "&pagemode=iframe&security=852023&tabSet=" + areaName + "&rof=true&inlineEdit=1");

    And I am using CRM 2015.


    Here is my complete script:

    function onLoad() {
    debugger;
    var recordId = Xrm.Page.data.entity.getId().replace("{", "").replace("}", "");//Entity record id
    var oTypeCode = Xrm.Page.context.getQueryStringParameters().etc;//Entity Type code. for lead it is 4
    var IFrame = "IFRAME_IFRAME_Documents";//Iframe Name
    var relName = Xrm.Page.data.entity.getEntityName() + "_SharepointDocument"; //Entity Relation name. Like for Lead it is Lead_SharepointDocument
    SetIframeContent(IFrame, oTypeCode, relName, recordId);
    }
    function SetIframeContent(iframeObjId, objectType, areaName, recordId) {
    var iframeObject = Xrm.Page.getControl(iframeObjId);//Get iFrame control
    if (iframeObject != null) {
    //Set iframe URL
    iframeObject.setSrc(Xrm.Page.context.getClientUrl() +"/userdefined/areas.aspx?oId=" + recordId + "&oType=" + objectType + "&pagemode=iframe&security=852023&tabSet=" + areaName + "&rof=true&inlineEdit=1");
    }
    }
  • meenoo Profile Picture
    7,316 on at

    Hi Roxanna,

    What do you see when you run your url directly in the browser?

    Thank you.

  • crmprogrammer2013 Profile Picture
    2,665 on at

    I see the same error.

    5460.Capture.PNG

    What am I doing wrong. Please suggest.

    Thanks for any help.

  • crmprogrammer2013 Profile Picture
    2,665 on at

    Any Suggestions please..

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans