locked
How to check the field value is updated using javascript in ms crm 2013 RRS feed

  • Question

  • Hi All,

    I am having a field Masked, now I need to check that the value is updated or not . If updated then the previous value has to be set.

    Please help me how to check that the value of the masked field is updated using javascript onsave event.

    Friday, June 6, 2014 9:06 AM

All replies

  • Put your code is try catch. Update field in try section and put alert in catch section. If the record is not saved the user will get the alert.

    Regards Faisal

    Friday, June 6, 2014 9:14 AM
  • I will explain more on it, I need to catch the value if it is changed otherwise no. So now I want to know whether the text in the field is change or not .

    I want to get the value of the field on load and compare the value of the same onsave.

    Friday, June 6, 2014 9:17 AM
  • check the field has been changed:-

    var isDirty = Xrm.Page.getAttribute(“CRMFieldSchemaName”).getIsDirty();
    alert(isDirty); // returns true if the field is dirty

    You don't need to compare if you get true value that means the field has been changed.


    Regards Faisal

    Friday, June 6, 2014 10:19 AM