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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Check if form is dirty before closing the tab in Unified Service Desk

(0) ShareShare
ReportReport
Posted on by 295

Dear all,

I am trying to prompt a user before the tab is closed if the form is dirty and has unsaved changes.

For example: A case tab is opened inside Unified Service Desk and it has unsaved changes and if the user attempts to close this tab it should give a warning either to stay on the page or close the tab.

I know I can use Xrm.Page.data.entity.getIsDirty() to check if the form is dirty or not. But i am having issues where should I run this script and how should I warn users before closing.


There will be 2 buttons on my dialog box ok and cancel. Ok will lead to closing the tab where as cancel will allow user to return to the same tab again and save the unsaved changes.

I have the same question (0)
  • Suggested answer
    Ricardo Afonso Profile Picture
    on at

    Hello,

    By default, if you have auto-save disabled for the environment, the system asks if you want to discard the unsaved changes made to the form or not. If the auto-save is enabled the changes should always be saved before the user closes the tab.

    You can read more about the auto-save feature here:

    docs.microsoft.com/.../manage-auto-save

  • Faran Saleem Profile Picture
    295 on at

    Hi Ricardo,

    I am not talking about a CRM Page outside USD. I am talking about inside USD. Closing the tab inside USD should give a prompt that you have unsaved changes.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 72 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 29 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans