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() - 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

  • 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 

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

    Hi Scott,

    Can you please look into below issue?

    community.dynamics.com/.../411030

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

    Hi Can you please look into this issue.

    community.dynamics.com/.../410686

  • Verified answer
    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
    ScottDurow 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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans