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

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