locked
Object doesn't support property or method "Form_onsave" RRS feed

  • Question

  • Dear all;

    i have import an unmanaged solution in mscrm 2011 which has some changes in appointment form  when i create new appointment it gives me an error 

    Object doesn't support property or method "Form_onsave" 

    i dont have any javascript on form save 

    Thursday, October 17, 2013 10:01 AM

All replies

  • Not sure the cause of this problem. 

    Check form properties ->Form -> OnSave .

    Though not a good solution, but you might try this 

    Xrm.Page.data.entity.removeOnSave("Form_onsave");
    Thursday, October 17, 2013 11:24 AM
  • Hi thanks for reply

    i put that line of code in javascript file and call it on form on save function (that is how i had to do?).but still the same error

    Thursday, October 17, 2013 11:32 AM
  • Hi,

    Since there is no on save javascript on the form, could you please check if save button is overridden by custom functionality. (Under Actions Tab of Command Definition for Save button). If may be because of javascript written on ribon button.

    Regards,

    Rameshwari

    • Proposed as answer by RameshwariSah Thursday, October 17, 2013 11:32 AM
    • Unproposed as answer by anwar_addi Thursday, October 17, 2013 11:42 AM
    Thursday, October 17, 2013 11:32 AM
  • Hi Ramesh;

    save button is default button of crm i have not written any javascript on it



    • Edited by anwar_addi Thursday, October 17, 2013 11:47 AM
    Thursday, October 17, 2013 11:41 AM
  • If you are using Internet Explorer, I would suggest to debug using Developer tools and see if any errors displayed on the console.

    Or if you have solution containing entity previous to import. Just restore and see if the error disappears.  Then compare both solutions.


    • Edited by CrmManju Thursday, October 17, 2013 4:29 PM
    Thursday, October 17, 2013 4:24 PM
  • Hi,

    Since you have imported the unmanaged solution, I would suggest you to export the entity in the solution and still check with xml definitions of the entity ribbon.

    Regards,

    Rameshwari

    Thursday, October 17, 2013 5:35 PM
  • I had the same issue in CRM 2013 and this is how I solved it.

    I created a new solution by going to Settings -> Solutions -> click on New, give a name and Save. Then I added the existing entity where the onSave issue is happening even without an onSave function. Then I exported the solution to my desktop as a .zip file. The zip file will have a WebResources folder, a [Content Types].xml, customizations.xml and solutions.xml files in it.

    a) I then copied the customizations.xml over to a different folder so that I can edit it and looked for the word 'Save'. I removed the <event></event> tags related to the onSave event that somehow got retained even though it was not in the Javascript (.js) file for that entity form. Then saved the customizations.xml file.

    b) I then replaced the customizations.xml file inside the .zip file above

    c) Then I imported the revised .zip file with the altered customizations.xml file in it and published the customizations.

    That did the trick!!! I did not get the Object doesn't support property or method "Form_onsave" error anymore. I hope this helps.

    Chad Sriram


    • Edited by Chad Sriram Wednesday, March 5, 2014 5:55 PM
    • Proposed as answer by Chad Sriram Wednesday, March 5, 2014 6:29 PM
    Wednesday, March 5, 2014 5:54 PM