Skip to main content

Notifications

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

  • Community Member Profile Picture
    on at
    RE: Xrm.Page.ui.close() - disable pop-up message

    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 

  • Community Member Profile Picture
    on at
    RE: Xrm.Page.ui.close() - disable pop-up message

    Hi Scott,

    Can you please look into below issue?

    community.dynamics.com/.../411030

  • Community Member Profile Picture
    on at
    RE: Xrm.Page.ui.close() - disable pop-up message

    Hi Can you please look into this issue.

    community.dynamics.com/.../410686

  • Verified answer
    Vijay Waghmare Profile Picture
    on at
    RE: Xrm.Page.ui.close() - disable pop-up message

    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

  • Suggested answer
    ScottDurow Profile Picture
    19 on at
    RE: Xrm.Page.ui.close() - disable pop-up message

    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

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
dkrishna Profile Picture

dkrishna 6

Featured topics

Product updates

Dynamics 365 release plans