locked
object doesn't support property or method 'toLocaleString' when trying to save the customization form RRS feed

  • Question

  • Hi Team,

    I am getting object doesn't support property or method 'toLocaleString' when trying to save the customization form.

    I just added validation onsave and added line to prevent save.

    ExecutionObj.getEventArgs().preventDefault();

    Thanks,

    Sreenath 

    Monday, November 25, 2013 1:18 PM

Answers

All replies

  • Inorder to prevent the save use the below line

    event.returnValue=false;

    Monday, November 25, 2013 1:22 PM
  • even after I remove all validations still getting same issue. No idea.

    Monday, November 25, 2013 1:27 PM
  • Hi Can you give detailed Descriptionj about your scenario.
    Monday, November 25, 2013 1:27 PM
  • write as toLocaleString();
    Monday, November 25, 2013 1:35 PM
  • I started to validate the form onsave. So I written code. it is giving validation alerts properly. But the form is submitting.

    So I need to  prevent form save.

    But the thing is even after I remove all validation code onsave I am getting same error which I mentioned in the subject.

    Thanks,

    sreenath

    Monday, November 25, 2013 1:36 PM
  • Hi,

    Follow these steps:

    1. Clear your browser cache.

    2. Close and reopen browser.

    3. If above doesn't resolve, Recycle the CRMAppPool in IIS and restart IIS on the server.

    4. If above doesn't resolve, restart the Async Service on the server.

    I hope this should resolve your issue.

    Thanks & Regards,


    Anubhav Bajpai

    Monday, November 25, 2013 1:40 PM
  • first of all remove the event which you added on save in the form properties.

    If you want to prevent the save operation write

    Xrm.Page.context.getEventArgs().preventDefault();

    Monday, November 25, 2013 1:41 PM
  • Hi,

    1 & 2 steps I done. It is not working. And mine is online instance. Please let me know how to do 3 and 4 steps.

    Thanks,

    sreenath

    Monday, November 25, 2013 1:52 PM
  • Cool,

    Leave 3,4 steps which are not relevant in case of Online.

    Now make a sample javascript file (in a notepad etc.) and upload it through browse button into the same javascript web resource file.

    the sample JS file can be

    function abc() {
    alert('Hi')
    }

    Once uploaded, save the JS webresource and Publish All Customizations.

    This will overwrite the existing code which gets remained while updating the code directly in the edit mode.

    check whether the alert is coming. If you getting the alert, then you can update your code to verify further changes.

    Normally I would suggest to Update the JS file in a notepad or any editor in which you are comfortable and then upload the JS file through the browse button.

    I have faced this problem many times, so I have stopped using the in-built editor. :(

    Thanks & Regards,


    Anubhav Bajpai




    • Edited by Anubhav Bajpai Monday, November 25, 2013 2:02 PM grammer change
    Monday, November 25, 2013 1:58 PM
  • Hi,

    One thing I found. Only in IE 9 I am getting the error which I mentioned in subject. In IE 10 form is saving without error. :)

    Now Tell me how to prevent form to save if criteria is not matched onsave.

    Regards,

    Sreenath

    Tuesday, November 26, 2013 5:38 AM
  • Hi,

    Please check following links

    http://community.dynamics.com/crm/b/crmmitchmilam/archive/2011/05/06/crm-2011-canceling-the-save-operation.aspx

    http://rajeevpentyala.wordpress.com/tag/preventdefault/


    Hope this helps. If you get answer of your question, please mark the response as an answer and vote as helpful !!!
    Vikram Singh. !!!  My Blog

    Tuesday, November 26, 2013 5:43 AM
  • Hi,

    Earlier it was not working due to some browser issue. It is working fine now.

    Thanks,

    Sreenath

    Tuesday, November 26, 2013 5:49 AM