locked
Associated view in iFrame clarification RRS feed

  • Question

  • I've seen Jim Wang's and DynamicsCare blogs about this. I seem to be missing something basic. If I want to show the Relationships view in an iFrame, I should follow these steps (please correct where I am wrong - because it is not loading a page in the iFrame):

    1. Add an iFrame to the form/tab ( i used the about:blank for the default URL)
    2. Add script to onLoad event (modified with iFrame name and area desired)
    3. Save Form and Publish Entity

    When I return to the contacts page, I get my about:blank page. No Associated View.
    Wednesday, March 17, 2010 1:43 PM

Answers

  • function GetFrameSource(tabSet)
    {
      if (crmForm.ObjectId != null)
        {
            var oId = crmForm.ObjectId;
            var oType = crmForm.ObjectTypeCode;
            var security = crmFormSubmit.crmFormSubmitSecurity.value;
            return “areas.aspx?oId=” + <ContactId> + “&oType=2&security=852023&tabSet=areaRelationships;
        }
        else
        {
            return “about:blank”;
        }
    }
    crmForm.all.IFRAME_Relationships.src = GetFrameSource(”areaRelationships”);

    Your code has errors - that's why it doesn't work. Try to use following:

    function GetFrameSource(tabSet)
    {
      if (crmForm.ObjectId != null)
        {
            var oId = crmForm.ObjectId;
            var oType = crmForm.ObjectTypeCode;
            var security = crmFormSubmit.crmFormSubmitSecurity.value;
            return "areas.aspx?oId=" + oId + "&oType=" + oType + "&security=" + security + "&tabSet=" + tabSet;
        }
        else
        {
            return "about:blank";
        }
    }
    crmForm.all.IFRAME_Relationships.src = GetFrameSource("areaRelationships");
    


    Truth is opened the prepared mind

    My blog (english)
    Мой блог (русскоязычный)
    Thursday, March 18, 2010 2:16 PM
    Moderator

All replies

  • Could you show script you use? Have you activated OnLoad script?
    Truth is opened the prepared mind

    My blog (english)
    Мой блог (русскоязычный)
    Thursday, March 18, 2010 9:29 AM
    Moderator
  • function GetFrameSource(tabSet)
    {
      if (crmForm.ObjectId != null)
        {
            var oId = crmForm.ObjectId;
            var oType = crmForm.ObjectTypeCode;
            var security = crmFormSubmit.crmFormSubmitSecurity.value;
            return “areas.aspx?oId=” + <ContactId> + “&oType=2&security=852023&tabSet=areaRelationships;
        }
        else
        {
            return “about:blank”;
        }
    }
    crmForm.all.IFRAME_Relationships.src = GetFrameSource(”areaRelationships”);
    Thursday, March 18, 2010 2:08 PM
  • function GetFrameSource(tabSet)
    {
      if (crmForm.ObjectId != null)
        {
            var oId = crmForm.ObjectId;
            var oType = crmForm.ObjectTypeCode;
            var security = crmFormSubmit.crmFormSubmitSecurity.value;
            return “areas.aspx?oId=” + <ContactId> + “&oType=2&security=852023&tabSet=areaRelationships;
        }
        else
        {
            return “about:blank”;
        }
    }
    crmForm.all.IFRAME_Relationships.src = GetFrameSource(”areaRelationships”);

    Your code has errors - that's why it doesn't work. Try to use following:

    function GetFrameSource(tabSet)
    {
      if (crmForm.ObjectId != null)
        {
            var oId = crmForm.ObjectId;
            var oType = crmForm.ObjectTypeCode;
            var security = crmFormSubmit.crmFormSubmitSecurity.value;
            return "areas.aspx?oId=" + oId + "&oType=" + oType + "&security=" + security + "&tabSet=" + tabSet;
        }
        else
        {
            return "about:blank";
        }
    }
    crmForm.all.IFRAME_Relationships.src = GetFrameSource("areaRelationships");
    


    Truth is opened the prepared mind

    My blog (english)
    Мой блог (русскоязычный)
    Thursday, March 18, 2010 2:16 PM
    Moderator
  • I had originally tried that, but hard-coded some of the values because I was having issues. Regardless, your version works fine. Thanks!
    Thursday, March 18, 2010 5:33 PM