web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Xrm.Page.ui.close() prompting prompt two times for unsaved data.

(0) ShareShare
ReportReport
Posted on by

After disabled the auto save functionality when I do some changes in contact or account entity and clicked on Close button, then system prompt two times for unsaved data.

I have checked that it prompted two times on our custom code i.e.  Xrm.Page.ui.close().

When I comment out the above code then it doesn’t not close the page and doesn’t prompt to save or discard. 

Below is piece of code calling from close button. 

function Close() {       

        Xrm.Page.ui.close();

}

Please help me to resolve this issue

*This post is locked for comments

I have the same question (0)
  • Rajkumar Rajaraman Profile Picture
    on at

    Try this

    var attributes = Xrm.Page.data.entity.attributes.get();

     for (var i in attributes)

       {       attributes[i].setSubmitMode(“never”); }

    Xrm.Page.ui.close();

  • Community Member Profile Picture
    on at

    Rajkumar, I tried your solution It doesn't prompt any alert.

    My issue is two times prompt coming  at Xrm.Page.ui.close().

  • Rajkumar Rajaraman Profile Picture
    on at

    so you need all the required fields are updated then save and close the form without asking any prompt?

  • Community Member Profile Picture
    on at

    My issue is when edit some record and clicked on custom close button.

    In the close button i called Xrm.Page.ui.close() and because of this two times prompt is asking for unsaved data. I need only one time prompt.

  • Rajkumar Rajaraman Profile Picture
    on at

    post your code on here for inquiry

  • Community Member Profile Picture
    on at

    There is custom button and below code is executed when we clicked on Custom button.

    function Close() {      

           Xrm.Page.ui.close();

    }

  • Rajkumar Rajaraman Profile Picture
    on at

    Nausher,

    Try this:

    var attributes = Xrm.Page.data.entity.attributes.get();

       for ( var i in attributes){

           attributes[i].setSubmitMode("never");

       }

    Xrm.Page.ui.close();

    Xrm.Page.data.entity.save("saveandclose");

    Refer this:

    stackoverflow.com/.../dynamics-crm-2011-disable-pop-up-that-comes-after-xrm-page-ui-close

    Hope this helps.

    Regards,

    R.Rajkumar

    "Please mark my answer as verified if you found it helpful"

  • Community Member Profile Picture
    on at

    Rajkumar,

    I try your solution and it disabled the pop-up.

    My issue is that two pop-up is coming and i need only one pop-up.

  • Rajkumar Rajaraman Profile Picture
    on at

    Xrm.Page.data.entity.save();

    //after put

    Xrm.Page.ui.close();

  • Community Member Profile Picture
    on at

    No luck.

    Rajkumar you understand my issue ?

    My issue when click on close button two pop-up is coming asking for save or discard. I need only one pop-up.

    I think one is coming from Xrm.Page.ui.close() and another may be come from close windows(as window is closing).

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans