locked
Problem with print preview form RRS feed

  • Question

  • Hello, we added some subgrids into the oportunity form and we need to see the form in print preview. But the print preview form gets the javascript error (we didnt do any javascript in this form). The content of the error (data which should be send to MS) is:

    <CrmScriptErrorReport>
      <ReportVersion>1.0</ReportVersion>
      <ScriptErrorDetails>
       <Message>Error initializing component with element id='null' and with type='Mscrm.GridSpanControl': Unable to set value of the property 'control': object is null or undefined</Message>
       <Line>0</Line>
       <URL>/_forms/print/custformprint.aspx?allsubgridspages=false&id=%7bD792F388-63B1-E111-981C-545D24133A12%7d&objectType=3&preview=&subType=</URL>
       <PageURL>/_forms/print/custformprint.aspx?allsubgridspages=false&id=%7bD792F388-63B1-E111-981C-545D24133A12%7d&objectType=3&preview=&subType=</PageURL>
       <Function>anonymous(type,properties,events,references,element){try{!Mscrm.PageManager.$18_2&&$create(type,properties,events,references,element)}catch($v_0){var$v_1=String.format("Errorinitializingcomponentwithelementid='{0}'andwithtype='{1}':{2}",!element?"null":el</Function>
       <CallStack>
        <Function>anonymous(type,properties,events,references,element){try{!Mscrm.PageManager.$18_2&&$create(type,properties,events,references,element)}catch($v_0){var$v_1=String.format("Errorinitializingcomponentwithelementid='{0}'andwithtype='{1}':{2}",!element?"null":element.id,!type?"null":type.getName(),$v_0.message);catchError($v_1,window.location.href,0,true)}}</Function>
        <Function>crmApplicationInitHandler()</Function>
        <Function>anonymous(c,d){for(varb=0,e=a.length;b<e;b++)a[b](c,d)}</Function>
        <Function>anonymous(){vara=this.get_events().getHandler("init");if(a){this.beginCreateComponents();a(this,Sys.EventArgs.Empty);this.endCreateComponents()}}</Function>
        <Function>anonymous(){if(!this.get_isInitialized()&&!this._disposing){Sys._Application.callBaseMethod(this,"initialize");this._raiseInit();if(this.get_stateString){if(Sys.WebForms&&Sys.WebForms.PageRequestManager){this._beginRequestHandler=Function.createDelegate(this,this._onPageRequestManagerBeginRequest);Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._beginRequestHandler);this._endRequestHandler=Function.createDelegate(this,this._onPageRequestManagerEndRequest);Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler)}vara=this.get_stateString();if(a!==this._currentEntry)this._navigate(a);elsethis._ensureHistory()}this.raiseLoad()}}</Function>
        <Function>b()</Function>
        <Function>anonymous(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",a);b()}}</Function>
       </CallStack>
      </ScriptErrorDetails>
      <ClientInformation>
       <BrowserUserAgent>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0E)</BrowserUserAgent>
       <BrowserLanguage>en-us</BrowserLanguage>
       <SystemLanguage>cs</SystemLanguage>
       <UserLanguage>cs</UserLanguage>
       <ScreenResolution>1600x900</ScreenResolution>
       <ClientName>Web</ClientName>
       <ClientTime>2012-09-19T07:28:25</ClientTime>
      </ClientInformation>
      <ServerInformation>
        <OrgLanguage>1029</OrgLanguage>
        <OrgCulture>1029</OrgCulture>
        <UserLanguage>1029</UserLanguage>
        <UserCulture>1029</UserCulture>
        <OrgID>{44DA156F-0DA3-E111-ABF2-545D24133A12}</OrgID>
        <UserID>{AB0E84E3-10A3-E111-ABF2-545D24133A12}</UserID>
        <CRMVersion>5.0.9690.2243</CRMVersion>
      </ServerInformation>
    </CrmScriptErrorReport>

    <CrmScriptErrorReport>
      <ReportVersion>1.0</ReportVersion>
      <ScriptErrorDetails>
       <Message>Error initializing component with element id='null' and with type='Mscrm.CompositeControl': Unable to set value of the property 'control': object is null or undefined</Message>
       <Line>0</Line>
       <URL>/_forms/print/custformprint.aspx?allsubgridspages=false&id=%7bD792F388-63B1-E111-981C-545D24133A12%7d&objectType=3&preview=&subType=</URL>
       <PageURL>/_forms/print/custformprint.aspx?allsubgridspages=false&id=%7bD792F388-63B1-E111-981C-545D24133A12%7d&objectType=3&preview=&subType=</PageURL>
       <Function>anonymous(type,properties,events,references,element){try{!Mscrm.PageManager.$18_2&&$create(type,properties,events,references,element)}catch($v_0){var$v_1=String.format("Errorinitializingcomponentwithelementid='{0}'andwithtype='{1}':{2}",!element?"null":el</Function>
       <CallStack>
        <Function>anonymous(type,properties,events,references,element){try{!Mscrm.PageManager.$18_2&&$create(type,properties,events,references,element)}catch($v_0){var$v_1=String.format("Errorinitializingcomponentwithelementid='{0}'andwithtype='{1}':{2}",!element?"null":element.id,!type?"null":type.getName(),$v_0.message);catchError($v_1,window.location.href,0,true)}}</Function>
        <Function>crmApplicationInitHandler()</Function>
        <Function>anonymous(c,d){for(varb=0,e=a.length;b<e;b++)a[b](c,d)}</Function>
        <Function>anonymous(){vara=this.get_events().getHandler("init");if(a){this.beginCreateComponents();a(this,Sys.EventArgs.Empty);this.endCreateComponents()}}</Function>
        <Function>anonymous(){if(!this.get_isInitialized()&&!this._disposing){Sys._Application.callBaseMethod(this,"initialize");this._raiseInit();if(this.get_stateString){if(Sys.WebForms&&Sys.WebForms.PageRequestManager){this._beginRequestHandler=Function.createDelegate(this,this._onPageRequestManagerBeginRequest);Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._beginRequestHandler);this._endRequestHandler=Function.createDelegate(this,this._onPageRequestManagerEndRequest);Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler)}vara=this.get_stateString();if(a!==this._currentEntry)this._navigate(a);elsethis._ensureHistory()}this.raiseLoad()}}</Function>
        <Function>b()</Function>
        <Function>anonymous(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",a);b()}}</Function>
       </CallStack>
      </ScriptErrorDetails>
      <ClientInformation>
       <BrowserUserAgent>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0E)</BrowserUserAgent>
       <BrowserLanguage>en-us</BrowserLanguage>
       <SystemLanguage>cs</SystemLanguage>
       <UserLanguage>cs</UserLanguage>
       <ScreenResolution>1600x900</ScreenResolution>
       <ClientName>Web</ClientName>
       <ClientTime>2012-09-19T07:28:25</ClientTime>
      </ClientInformation>
      <ServerInformation>
        <OrgLanguage>1029</OrgLanguage>
        <OrgCulture>1029</OrgCulture>
        <UserLanguage>1029</UserLanguage>
        <UserCulture>1029</UserCulture>
        <OrgID>{44DA156F-0DA3-E111-ABF2-545D24133A12}</OrgID>
        <UserID>{AB0E84E3-10A3-E111-ABF2-545D24133A12}</UserID>
        <CRMVersion>5.0.9690.2243</CRMVersion>
      </ServerInformation>
    </CrmScriptErrorReport>

    What is wrong?

    Thanks


    Pavel Brestovsky

    Wednesday, September 19, 2012 5:33 AM

Answers

  • Pavel,

    EDIT: I just noticed this within the UR11 release notes -

    "When you try to close the Print Preview form, a script error occurs. This issue occurs when a tab that contains a subgrid is hidden. "

    I've not tested but it sounds like our issue will be fixed in UR11.

    Original Message:

    I just ran into this issue as well.  After preliminary testing, it appears that these errors appear on the print preview page when you have done the either of the following:

    1) Through form customizations, set a tab that contains a subgrid to not be visible by default

    2) Through from customizations, set a tab that contains a web resource to not be visible by default

    A Microsoft Ticket should be opened detailing this issue to get a true resolution.  However, a potential workaround that prevents the error in the meantime could be one of the following:

    1) Not hide the tab that contains your subgrid or web resource

    2) Hide the section that contains your subgrid or web resource, and leave the tab as visible

    3) Write javascript on load of the form to hide the tab

    Unfortunately, the print form does not execute javascript so it will not hide your tab as you may currently desire, though.

    Thursday, October 18, 2012 7:27 PM

All replies

  • Pavel,

    EDIT: I just noticed this within the UR11 release notes -

    "When you try to close the Print Preview form, a script error occurs. This issue occurs when a tab that contains a subgrid is hidden. "

    I've not tested but it sounds like our issue will be fixed in UR11.

    Original Message:

    I just ran into this issue as well.  After preliminary testing, it appears that these errors appear on the print preview page when you have done the either of the following:

    1) Through form customizations, set a tab that contains a subgrid to not be visible by default

    2) Through from customizations, set a tab that contains a web resource to not be visible by default

    A Microsoft Ticket should be opened detailing this issue to get a true resolution.  However, a potential workaround that prevents the error in the meantime could be one of the following:

    1) Not hide the tab that contains your subgrid or web resource

    2) Hide the section that contains your subgrid or web resource, and leave the tab as visible

    3) Write javascript on load of the form to hide the tab

    Unfortunately, the print form does not execute javascript so it will not hide your tab as you may currently desire, though.

    Thursday, October 18, 2012 7:27 PM
  • Hi Pavel,

    Did Mike provide you with the answer? if so, please mark his post as the answer so he may receive points and also indicate to other users who have the same issue that his answer is indeed correct.

    Thanks


    Microsoft Certified Technology Specialist (CRM) GAP Consulting Ltd Microsoft Community Contributor Award 2011

    Monday, October 29, 2012 10:23 PM
    Answerer