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.

  • Faran Saleem Profile Picture
    Faran Saleem 295 on at
    RE: Check if form is dirty before closing the tab in Unified Service Desk

    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.

  • Suggested answer
    RE: Check if form is dirty before closing the tab in Unified Service Desk

    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

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