Search code examples
iframedynamics-crmdynamics-crm-2013

IFrame section produces CRM error, but only when it's the top-left section of the Tab page


I'm using the on-premise version of CRM2013 SP1, Update Rollup 1 (v6.1.1.132), with Dutch as the primary language.

I have customized the default Contact form to display an IFrame in the first (i.e. top-left section) of a tab page.
When I view a Contact using this form the IFrame displays correctly; however, when I click on any of the buttons in the navigation ribbon to leave the Contact form, I consistently get an error dialog saying that an error has occured. I've pasted the contents of the error report below.

What I observed is that this error only occurs if the IFrame section is the first section within the tab page; if I swap the IFrame section with another section so that its no longer in the top left, the error does not occur. I've tried this in both Firefox 33 and Internet Explorer 10, and both produce the same results. Also, the contents I'm displaying in the IFrame is a simple Hello world text, nothing to do with javascript or anything.

Can anyone confirm that this is indeed a javascript bug in CRM?

And if so, what would be the best way to let Microsoft know about this? From what I can tell, Microsoft Connect doesn't appear to be accepting bugs for Microsoft CRM.

The error report:

<CrmScriptErrorReport>
  <ReportVersion>1.0</ReportVersion>
  <ScriptErrorDetails>
   <Message>TypeError: $v_3.get_disabled is not a function</Message>
   <Line>2</Line>
   <URL>/_common/JsProvider.ashx?ids=1959345455-451858892-1713948411-1401263868-1250882489-367493978-19173614-574022791-696891199-2007586035-1552783829&ver=-510216734</URL>
   <PageURL>/main.aspx?etc=2&extraqs=%3f_gridType%3d2%26etc%3d2%26id%3d%257b2F154F9A-E94D-E311-93FB-00155D01041C%257d%26rskey%3d%257b00000000-0000-0000-00AA-000010001003%257d&pagemode=iframe&pagetype=entityrecord&rskey=%7b00000000-0000-0000-00AA-000010001003%7d</PageURL>
   <Function>anonymousr:$v_3.get_disabledisnotafunction</Function>
   <CallStack>
    <Function>anonymousr:$v_3.get_disabledisnotafunction</Function>
   </CallStack>
  </ScriptErrorDetails>
  <ClientInformation>
   <BrowserUserAgent>Mozilla/5.0 (Windows NT 6.2; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0</BrowserUserAgent>
   <BrowserLanguage>undefined</BrowserLanguage>
   <SystemLanguage>undefined</SystemLanguage>
   <UserLanguage>undefined</UserLanguage>
   <ScreenResolution>1920x1200</ScreenResolution>
   <ClientName>Web</ClientName>
   <ClientTime>2014-11-06T11:05:10</ClientTime>
  </ClientInformation>
  <ServerInformation>
    <OrgLanguage>1043</OrgLanguage>
    <OrgCulture>1043</OrgCulture>
    <UserLanguage>1043</UserLanguage>
    <UserCulture>1043</UserCulture>
    <OrgID>{BE563A4F-7AB1-4884-AFD4-6C1C72482A31}</OrgID>
    <UserID>{F78440C6-E24D-E311-93FA-00155D01041C}</UserID>
    <CRMVersion>6.1.1.132</CRMVersion>
  </ServerInformation>
</CrmScriptErrorReport>

Solution

  • I created a support ticket with Microsoft for this, and they could reproduce this problem (but only in CRM2013, not in CRM2015). Microsoft recommended the following workaround:

    Add the below Javascript to the onLoad event of the Contact form.

    function checkDisabled() {
        var ctrl = Xrm.Page.getControl('IFRAME_helloWorld'); //schema name of the IFrame
        if (ctrl) {
            if (!ctrl.get_disabled) {
                ctrl.get_disabled = function () { return true; }
            }
        }
    }
    

    Works like a charm.