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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Xrm.Page.ui.close() - disable pop-up message

(0) ShareShare
ReportReport
Posted on by 2,505

How to disable the pop-up ("There are unsaved changes in this window...") that comes after calling Xrm.Page.ui.close()? I'm calling this function straight after Xrm.Page.data.entity.save() so all the fields are saved.

This solution setSubmitMode("never") does not work:

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

   for ( var i in attributes){

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

   }

   Xrm.Page.ui.close();

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    ScottDurow Profile Picture
    23 on at

    Hi,

    Is this CRM2013 or CRM2011? You shouldn't be getting the popup if there are no dirty fields.

    Try looking at what Xrm.Page.data.entity.getDataXml() and see what fields the form things are still dirty. I've seen situations where there are trailing spaces on lookup name attributes from import that cause fields to be seen as dirty when they are not.

    hth,

    Scott

  • Verified answer
    Vijay Waghmare Profile Picture
    on at

    if you are calling Xrm.Page.ui.close() after Xrm.Page.data.entity.save(), why you are not using Xrm.Page.data.entity.save("saveandclose"). since it will save all your unsaved data and will close the form.

    Thanks,

    Vijay

  • Community Member Profile Picture
    on at

    Hi Can you please look into this issue.

    community.dynamics.com/.../410686

  • Community Member Profile Picture
    on at

    Hi Scott,

    Can you please look into below issue?

    community.dynamics.com/.../411030

  • Community Member Profile Picture
    on at

    i have set values to fields using javascript on load. when my form loaded those are set default but here my scenario is when i am not fillling other required fields and moving to other record it is showing alert msg to save the fields obtained through JScript i want to avaoid thet alert 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans