locked
Missing navigation CRM 2013 RRS feed

  • Question

  • Hi,

    I have problem with add missing relationship to navigation.

    I tried develop missing Relationship between contact and lead on Contact form. I create new webresource as HTML.

    Then I implement following code:

    <html><head>
        <title>Untitled Page</title>
        <script language="javascript" type="text/javascript">
    
                
                //get the context
                var Xrm = window.parent.Xrm;
    
                var oId = Xrm.Page.data.entity.getId();
                var oType = Xrm.Page.context.getQueryStringParameters().etc;
    
    
                //set Relationship Name
                var relName = "lead_parent_contact";
    
                //building a url
                var sUrl = "/userdefined/areas.aspx?oId=" + oId + "&oType=" + oType + "&pagemode=iframe&rof=true&inlineEdit=1&security=852023&tabSet=" + relName + "&theme=Outlook15White";
    
    			           
                //get relative path with orgname as required
                var endUrl = Xrm.Page.context.prependOrgName(sUrl );
                
                window.location = endUrl;
                   
        </script>
    <meta charset="utf-8"></head>
    <body>
    
    </body></html>

    When I open this webrource in navigation I am able to see content of relastionships as associated view.

    LeadToContact

    Do you have any idea where is the problem.

    We have CRM 2013 SP1 RU 2 with IFD + ADFS.

    I tried a lot of solutions from other websites. When I copy it and insert it to webresource it show me only empty site with blue color.

    Thanks For Help


    • Edited by Filip Zvolensky Wednesday, May 6, 2015 10:43 AM mistake in code
    Wednesday, May 6, 2015 10:40 AM

All replies

  • The curley braces in the URL (from the oId) must be URLencoded:

    sUrl = sUrl.replace("{", "%7b").replace("}", "%7d");

    The resulting URL will resemble the following:

    "/userdefined/areas.aspx?formid=045cb3f9-1658-426c-8484-afdf53051d22&inlineEdit=1&oId=%7bA7369DD9-F1CC-4FE7-B278-5973B42C1CA0%7d&oType=1&pagemode=iframe&rof=true&security=852023&tabSet=areaOpps&theme=Outlook15White"

    Thursday, June 25, 2015 12:42 PM