none
Displaying Contact in an Iframe on Custom Entity form

    Question

  • Hi

    I have a custom entity called as store visit. on which i want to show a contacts related to store visit. contacts & store visits have N : N relation. i am writing following code in onload event of store visit. i get "invalid argument" error:

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

      // Waits for the content window of the IFrame to be ready
      function FixStylingInFrameSource(iframeID) {
          // Check the content window's ready state
          if (document.getElementById(iframeID).contentWindow.document.readyState
    != "complete") {
              // Re-run this function in 10 ticks
              window.setTimeout(function() { FixStylingInFrameSource(iframeID) }, 10);
          }
          // Content window is ready
          else {
              // Change the background color
              document.getElementById(iframeID).contentWindow.document.body.style.backgroundColor = "#eef0f6";
              // Remove the left border
              document.getElementById(iframeID).contentWindow.document.body.all(0).style.borderLeftStyle = "none";
              // Remove padding
              document.getElementById(iframeID).contentWindow.document.body.all(0).all(0).all(0).all(0).style.padding = "0px";

              // Make the cell the full width of the IFRAME
             document.getElementById(iframeID).contentWindow.document.body.all(0).style.width = "102%"

              // Show the IFrame
              document.getElementById(iframeID).style.display = "block";
          }
      }


    if(crmForm.FormType != 1)
    {
      crmForm.all.IFRAME_contacts.src = GetFrameSource("areanew_newstorevisits_Contacts");
      FixStylingInFrameSource('IFRAME_contacts');
    }

    Thursday, August 19, 2010 11:42 AM

Answers