locked
How to Set isDirty to false?? RRS feed

  • Question

  • hallo all, I have some code in OnLoad() Event, that automatically fill at lookup attribute, but if i don't want save this record always appear prompt :

    --------------------------- Windows Internet Explorer --------------------------- Are you sure you want to navigate away from this page? Your changes have not been saved. To stay on the page so that you can save your changes, click Cancel. Press OK to continue, or Cancel to stay on the current page. --------------------------- OK Cancel ---------------------------

    above indicate contain any fields in the form have been modified, i try to set isDirty in form to false but not success. any idea for that prompt not appear again?

    thanks.

    Glo.
    Friday, June 5, 2009 2:47 AM

Answers

  • Hi ,

    You cans et the dirty property to false by

    crmForm.IsDirty=false;

    And as Glo said To cancel the dialog call crmForm.detachCloseAlert();

    This will disable the dialog (for that form). The user will not be notified with the dialogue box if he closes the window without saving
    Thanks, Aarch
    Friday, June 5, 2009 5:06 AM

All replies

  • Hi gloamingon

    Try to use, crmForm.detachCloseAlert();
    Put it in the onload JS last line.

    FYI: if you want to use the isDirty, remember to write the (). Eg; isDirty()


    regards,
    Toong Yang
    http://eastoceantechnical.blogspot.com/
    Friday, June 5, 2009 3:47 AM
  • Hi ,

    You cans et the dirty property to false by

    crmForm.IsDirty=false;

    And as Glo said To cancel the dialog call crmForm.detachCloseAlert();

    This will disable the dialog (for that form). The user will not be notified with the dialogue box if he closes the window without saving
    Thanks, Aarch
    Friday, June 5, 2009 5:06 AM