CRM 2013: Strange 'Form_onload' error message in opportunity RRS feed

  • Question

  • We have a solution, written in CRM 2011. (All CRM Online)

    It has been imported into a 2013 development environment as an unmanaged solution and works fine.

    We have now deployed it to a demo site as a Managed solution.

    When I open the opportunity form to create a new record I get:

    Message from webpage
    There was an error with this field's customized event.



    Error:Object doesn't support property or method 'Form_onload'

    This happens on both the Opportunity and Information version of the form.  We do have some JS onload but the function is not 'Form_onload' and is not references as such anywhere.  All is well on the dev site.

    I have disabled the JS on the form and still get the error.

    Is this an internal CRM issue perhaps related to 2011/2013 or can I be causing this somehow?

    Thursday, October 31, 2013 4:19 PM

All replies

  • Any luck with this?  Currently seeing the exact same issue.
    Friday, December 6, 2013 3:38 PM
  • Double check you form XML - ran into this problem recently and it turns out there were some references to system JavaScript files that had gotten removed. 

    Specifically on Opportunity this was the section, and all the <internaljscriptfile> references were gone:

    	<internaljscriptfile src="/_static/sfa/sfautil.js" />
    	<internaljscriptfile src="/_static/sfa/opps/opps.js" />
    	<internaljscriptfile src="/_static/sfa/quotes/qoi_script.js" />
    	<internaljscriptfile src="$webresource:Opportunity_main_system_library.js" />

    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Thursday, December 12, 2013 5:28 PM
  • Hi Jason....

    I've just started getting the same error....

    I checked the Form XML, and it does indeed show those references....

    How did you resolve in the end?


    www.crmconsult.info Twitter:robertpeledie

    • Proposed as answer by jpaguila Sunday, April 5, 2015 12:41 AM
    Thursday, April 3, 2014 11:01 AM
  • All I can suggest if that you create a temporary solution with the Opportunity and related resources (will make finding things a bit quicker).

    Export it and look in the Solution.XML.

    Search through for JS files and see if there is anything in there that isn't yours.  You can try removing anything which looks wrong but take care.  If in doubt check with MS or forums.

    In my case there were references to JS files from an older version of Dynamics which simple shouldn't show up in the solution file as they are internal to Microsoft.

    Another tactic is to get hold of a vanilla solution.xml just to double check that what you are removing should not be in your solution.

    Hope that is of some help to you.

    Thursday, April 3, 2014 1:09 PM
  • It was just because of a missing ReWrite Module Component for the CRM website in IIS.

    Step 1 

    Launch IIS Manager on the CRM Server

    Click Modules.

    Verify ReWriteModule is listed in here (%SystemRoot%\System32\Inetsrv\rewrite.dll)

    Step 2

    Verify 3 rules exist in the URL Rewrite (ClientGlobalContectRule, WebResourcesRule, FederationMetadataRule)

    Step 3

    Repair or Reinstall URL ReWriteModule for your own version like 1.0 or 2.0.

    This one is 2.0 ( http://www.microsoft.com/en-us/download/details.aspx?id=34753 )

    This update for the Microsoft URL Rewrite Module 2.0 fixes the issues that are described in KB2749660.

    Step 4

    Reboot the CRM Server after  reinstalling the module.

    When module is correctly installed,the CRM website web.config file should be automatically updated.

    To verify this open the CRM website web.config file and make sure the following element is present under

      <rule name="ClientGlobalContextRule" stopProcessing="true">
       <match url="/?([0-9a-zA-Z][^/]*)?/?((?:%7b|\{)[^/]*(?:%7d|\}))?/?(WebResources|Handlers)/ClientGlobalContext.js.aspx" />
        <action type="Rewrite" url="/{R:1}/_Common/ClientGlobalContext.js.aspx" /> 
     <rule name="WebResourcesRule" stopProcessing="true">      
       <match url="/?([0-9a-zA-Z][^/]*)?/?((?:%7b|\{)[^/]*(?:%7d|\}))?/?webresources/([^\\?]+)" />
          <action type="Rewrite" url="/{R:1}/Handlers/WebResource.ashx?name={R:3}" /> </rule>
      <rule name="FederationMetadataRule" stopProcessing="true"> 
      <match url="FederationMetadata/2007-06/FederationMetadata.xml" />
       <action type="Rewrite" url="/Handlers/FederationMetadata.ashx" /> </rule>

    When entity form is requested from the CRM Server, the URL is built dynamically using URL ReWrite Component.More information about URL Rewriting  is found here 





    Friday, April 4, 2014 11:58 AM
  • When I compared a "vanilla" customizations.xml to my customizations.xml , both of which only contain the entity that was having issues, I found a <Handler> with a functionName of an old onLoad function that I removed. However, it was still trying to call the old onLoad function. I removed the Handler and everything is working.
    Wednesday, April 30, 2014 5:36 PM