locked
Object doesn't support property or method 'Form_onload' each time a form is open RRS feed

  • Question

  • Dear all,

    I have installed a fresh CRM server, everything work ok.

    But I have a strange behaviour is that when I open the URL within Explorer 9 on the server, each time a form gets display I get a popup error message

    "Object doesn't support property or method 'Form_onload"

    Any iodea what it could be ?

    regards

    serge


    Your knowledge is enhanced by that of others.
    Friday, August 19, 2011 3:02 PM

All replies

  • Hi,

    Are you facing the error on every CRM entity form?


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Friday, August 19, 2011 4:38 PM
  • Yes it happens on any form.

    It seems it happen only if I open the url from the server side.

    Doing it from client machine does not have that error

    Any ideas?


    Your knowledge is enhanced by that of others.
    Friday, August 19, 2011 5:50 PM
  • Hi,

    If it s only happening from the server side then make sure to add the website into the trusted site zone and try disabling IE Enhanced Security on server.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Friday, August 19, 2011 6:00 PM
  • Sorry I was a bit too fast.

    It is haapening also from client on ech form entity load.

    Any idea ?

    I am using Explorer 9.0

     

    thnaks for help

    serge


    Your knowledge is enhanced by that of others.
    Saturday, August 20, 2011 3:32 PM
  • Hi,

    Few questions:

    1. Have you imported the CRM 4.0 organization database into CRM 2011 via Deployment Manager?

    2. Do you have more then one CRM organization? if yes then are you also facing the same problem with the other organization?

    I would suggest you to try the following:

    1. Open Account entity Form (Settings->Customization->Cusotmizations->Customize the System->Entities->Account->Forms , double click on the information form)

    2. Click on Form Preperties and check if Form OnLoad event handler is attached

    3. If no event handle is attached then create a new JScript library and function with name Form_onload and attach it with the Form Onload Event handler (you may also reffer the following post for attaching the event handler: http://ayazahmad.wordpress.com/2010/09/25/javascript-libraries-in-microsoft-dynamics-crm-2011/)

     


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Saturday, August 20, 2011 4:02 PM
  • In reply to your questions :

    1- It is a fresh CRM 5.0 installation on which I have imported an existing 5.0 organisation from an other machine which is out of order

    2 - I have a single organisation

     

    Some more information :

    Today it happen on different places like for instance :

    - If I open a lead, no ERRROR
    - if I add an activity to that lead ERROR is occuring

    - If I open the product, ERROR occurs

     

    Here is what I have in acount form property:

    BUt I am not able to edit the event

     

     

     

    regards

    serge


    Your knowledge is enhanced by that of others.
    Sunday, August 21, 2011 5:46 AM
  • Hi,

    From the screenshot it is cleear that there is no function attached on Form OnLoad event, seems like something went wrong during importing an organization, usually these error occurs after importing CRM 4.0 database into CRM 2011. If the current organization is not in use and users are not entering live/production data then you can try the following steps:

    1. Restore previous CRM 2011 organization database backup in SQL Server

    2. Import the organization database as new organization

    3. Test if the error is resolved then disable old organization and then delete

    4. If the error still exsist then follow the steps below:

        a. Create New JScript webresource library with any name

        b. In library add function      

     function Form_onload() {

            }

        c. Add this function on Form Onload Event Handler (make sure to add the web resourc library first)


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Sunday, August 21, 2011 6:13 AM
  • steps 1 to 3 are the steps done already before.

    I have not so much experience in CRM customization, how to do step 4 ?

    How to create the scrip, what should be in the scripts ?

    Does it have to be added to all Entities Form load?

    thnaks for sample script if any and step by step guide

     

    regards

    serge


    Your knowledge is enhanced by that of others.
    Sunday, August 21, 2011 8:30 AM
  • Hi,

    You can following the steps as mentioned in this post: http://crmconsultancy.wordpress.com/2010/10/19/form-scripting-in-crm-2011/ , instead of creating a helloword function, you can create the one that i have mentioned above and in handler properties function name type Form_onload and no need to pass any paramter values. After adding make sure to publish customizations.

    If this solves your problem then you need to only add the same funciton on entity forms where you are facing the issue.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Jim Glass Jr Monday, August 22, 2011 7:30 PM
    Sunday, August 21, 2011 8:35 AM
  • ok I will give a try.

    Any idea what it is missing from a fresh install ?


    Your knowledge is enhanced by that of others.
    Sunday, August 21, 2011 8:43 AM
  • Hi,

    The reason for the error is not clear as still i am unable to produce the same error but saw this error in many forum posts and this issue is usually occurring after importing CRM 4.0 database into CRM 2011 deployment.

    I would suggest you to create a new organization via Deployment Manager to just make sure that the error is only occuring in the imported CRM 2011 organization database.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Sunday, August 21, 2011 8:46 AM
  • but if I create a new organisation via deployement manager , database will be empty and will not have my data ?
    Your knowledge is enhanced by that of others.
    Sunday, August 21, 2011 8:51 AM
  • Hi,

    Yes it will not have any data, i suggested just to ensure that if the error is related to your production CRM database or CRM installation files.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Sunday, August 21, 2011 8:56 AM
  • ok I will go back to office now and have a test and let you know in around 40 mn
    Your knowledge is enhanced by that of others.
    Sunday, August 21, 2011 9:01 AM
  • I have create the function named Form_Onload and attache it to the onload event handler for PRoduct category.
    Then publish change, save and close

    By re opening the product form, I get an error saying :

    "The value of the property Form_onload is null or not defined, not a function object"

    Function script is :

    function Form_onload() {
    alert("Hello world");       
    }

     

    Any idea?


    Your knowledge is enhanced by that of others.
    Sunday, August 21, 2011 9:50 AM
  • Hi,

    Can you post your JScript libary code or image? 

    Update: Add only the library contains the function and remove the Form Onload event handler, save and publish cusotmizations.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".




    Sunday, August 21, 2011 9:53 AM
  • Here is


    Your knowledge is enhanced by that of others.
    Sunday, August 21, 2011 10:17 AM
  • Hi,

    It is correct, try add only the library contains the function and remove the Form Onload event handler, save and publish cusotmizations.

    If the above does not help then:

    1. Try once again remimporting Dynamics CRM 2011 databse (many people get this issue fixed by reimporting i.e. http://stackoverflow.com/questions/5977050/crm-2011-with-no-javascript-customizations-gives-onload-errors)

    2. or else contact your CRM licensing/implementaiton Microsoft Partner or open a ticket via Microsoft Dynamics Customer Sourcehttp://www.microsoft.com/en-us/dynamics/customersource.aspx (On Purchasing /Upgrading Dynamics CRM, every customer recieves a 1 year support plan customer source account from Microsoft)


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Sunday, August 21, 2011 10:34 AM
  • No help, get initial error doing so

     

    In case I want to reinstalla again a fresh CRM Server and keep my existing database data how should I proceed ?

    1 -  Backup my Orgaanisation_MSCRM withing SQL server Administration to Orgaanisation_MSCRM.BAK

    2 - Uninstall CRM server component

    3 Re install fresh CRM server with the same Organisation name

    4 Restore Orgaanisation_MSCRM.BAK

     

    will it work like this ?

    I do not want to loose my data

     

    regards

    serge


    Your knowledge is enhanced by that of others.
    Sunday, August 21, 2011 10:40 AM
  • Hi,

    Yes, you described steps correctly, after restoring Organization_MSCRM.Bak database into SQL Server import Organization it via CRM Deployment Manager.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Sunday, August 21, 2011 10:45 AM
  • in the thread you mention people are talking about CRM data migration tool.

    Do I have to use this ?


    Your knowledge is enhanced by that of others.
    Sunday, August 21, 2011 10:55 AM
  • Hi,

    You do not need to use the data migration tool.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Sunday, August 21, 2011 11:00 AM
  • In case I which to rebuild my all server, and be sure to not lost my current CRM database.

    is it enought to backup the SQL server database myOrganisation_MSCRM ?

    Then re install from scratch my server and CRM server

    Then recovering my backup DB will get my all data without trouble ?

     

    regards

    serge


    Your knowledge is enhanced by that of others.
    Tuesday, August 23, 2011 4:26 PM
  • Hi,

    I would suggest you to backup both of CRM databases including MSCRM_CONFIG and  Organization_MSCRM.

    Yes reinstall server from the sctatch and then restore the Organization database into SQL Server and then Import Organization via CRM 2011 Deployment Manager.

    and if you still have any confusion then i would suggest you to contact your Microsoft Dynamics CRM Partner/implementor or intiate a case with Microsoft Support team via your company Customer Source Account http://www.microsoft.com/dynamics/en/au/customersource.aspx

    or to obtain the phone numbers for specific technology request please take a look at the web site listed below.

    http://support.microsoft.com/default.aspx?scid=fh;EN-US;PHONENUMBERS

    If you are outside the US please see http://support.microsoft.com for regional support phone numbers.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Tuesday, August 23, 2011 7:45 PM
  • Hi,

    For clarifications, you may also refer: http://technet.microsoft.com/en-us/library/gg554682.aspx


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Wednesday, August 24, 2011 6:06 AM
  • hello

    As you seems to have great expeience on crm are you able to help on following post :

    http://social.microsoft.com/Forums/en/crmdevelopment/thread/78eda31c-08d0-4a7f-ae05-4a90d96bed6d

     

    regards

    serge


    Your knowledge is enhanced by that of others.
    Thursday, August 25, 2011 6:58 AM
  • I was getting the same error pop-ups on a brand new CRM 2011 install.  I (luckily) found the answer to this and fixed without re-installing CRM.  

    I followed the information in the following site: http://blogs.msdn.com/b/emeadcrmsupport/archive/2011/08/31/crm-2011-form-errors-when-opening-non-customised-forms-object-doesn-t-support-property-or-method-form-load.aspx

    In my case, the URL rewrite rules (3 of them) were all missing.  I ran the URL rewrite MSI install file and chose repair.  I rebooted the server but the rules were not there.  I ended up copying the web.config code for the rewrites (copied the tags from <rewrite> to </rewrite> as shown in the above URL).  I then did an IIS Reset and the issue was resolved.

    So, my only question is this: why did my web.config file change and remove those 3 rewrite rules?  I found an older copy of the web.config file that contained those 3 rules.  

    Ed

     

    • Proposed as answer by Arpita Saini Monday, September 19, 2011 12:17 AM
    Thursday, September 15, 2011 8:20 PM
  • I make it work in my case by reinstalling in a clean machine
    Your knowledge is enhanced by that of others.
    Saturday, September 17, 2011 7:16 PM
  • Hi,

    If you find any of above reply useful then please Mark as Answer.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Saturday, September 17, 2011 7:24 PM
  • KIDDE I could kiss you. This solved the problem for me.

    I have a fresh CRM 2011 system on a new server with no javascript customisation. I imported the data from a non-Microsoft CRM solution, so the move from 4 to 2011 was not the cause.

    On the very last weekend of deployment I logged onto the server and without thinking clicked OK on the prompt to install CRM Rollup 6. After that this javascript error occured when opening most entity forms. Another effect was when clicking the "Import Data" ribbon menu item, selecting "Import Data" from the drop-down menu did not cause the Import Data form to appear.

    Rollup 6 deleted the rewrite section from the web.config file. Fortunately copying the section back in from the url you provided worked.

    Thanks to KIDDE for finding the answer. Thanks to the Dynamics CRM Team for suggesting the solution. No thanks to the producer of rollup 6.

    Ben

    • Proposed as answer by ECDC ICT Thursday, June 21, 2012 2:35 PM
    Sunday, January 29, 2012 9:32 AM
  • KIDDE I won't kiss you, but the UrlRewriteModule did take care of my problem.

    Thanks!

    Wednesday, March 21, 2012 4:05 PM