Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Unsaved changes IE alert would you like to leave page

Posted on by Microsoft Employee

Folks

randomly when I save a case (first creation) I am receiving the IE alert unsaved changes would you like to leave this page

in attempting to diagnose this, can anyone provide steps or recommendations where to look

yes I have workflows that fire after the record is created   is it possible a field is still dirty

I welcome any recommendations or thoughts on how to track this down

*This post is locked for comments

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Unsaved changes IE alert would you like to leave page

    Run this on save.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unsaved changes IE alert would you like to leave page

    should I run this onload

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Unsaved changes IE alert would you like to leave page

    Hi,

    You can check if the fields are dirty and get the dirty fields using Javascript.

    The IsDirty() Method returns a Boolean value indicating if there are unsaved changes to attributes values.

    //To Check if the entity is dirty
    var ismodified=Xrm.Page.data.entity.getIsDirty();
    //To Get Dirty Fields
    var attributes = Xrm.Page.data.entity.attributes.get() ;
    for (var i in attributes)
    {
    var attribute = attributes[i];
    if (attribute.getIsDirty())
    alert(“attribute dirty: ” + attribute.getName());
    }

    Hope this helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unsaved changes IE alert would you like to leave page

    yes I seen the second article

    so a page load which we us jscript there too  it is best to do the submit mode never there as shown in the article

  • Suggested answer
    PS Profile Picture
    PS 23,577 on at
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unsaved changes IE alert would you like to leave page

    I see where this is helpful for us

    but tell me, where would there be a situation you would us for ( var i in attributes){

          attributes[i].setSubmitMode("never"); like mentoned in the thread

  • Suggested answer
    PS Profile Picture
    PS 23,577 on at
    RE: Unsaved changes IE alert would you like to leave page

    Check Vijay's reply in the following thread

    community.dynamics.com/.../115916

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unsaved changes IE alert would you like to leave page

    yes we are updating fields with jscript and realtime workflows

    any tipes on how to avoid or work with that

  • Suggested answer
    PS Profile Picture
    PS 23,577 on at
    RE: Unsaved changes IE alert would you like to leave page

    Look at the following threads to identify dirty fields:

    community.dynamics.com/.../115916

    community.dynamics.com/.../192890

  • Suggested answer
    PS Profile Picture
    PS 23,577 on at
    RE: Unsaved changes IE alert would you like to leave page

    This usually happens if you update a field via javascript and in some cases real time workflow

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans