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,...
Unanswered

Bypassing the unsaved changes dialog when navigating away from a record in javascript - possible?

(0) ShareShare
ReportReport
Posted on by 7
0

We are implementing a custom duplicate detection handler off the save of a new contact record in D365. It is being done via Javascript. In the JS OnSave method, we stop the default save action and do some checks via WebAPI to determine whether this may be a duplicate or not.

If no potential duplicates are detected, we manually call the save again in JS.

If some potential duplicates are detected, we display a HTML web resource listing the possible duplicates.

What we are trying to achieve is that the user can double-click on one of the potential duplicates and we will navigate them directly to that other contact record without saving the record that the user was keying in originally (the whole point of this is not to save the duplicate record). We are using the Xrm.Navigation.openForm command to achieve this.

The problem is that by default this displays a popup to the user asking them if they wish to save their changes first before leaving the page. Once they have interacted with this dialog -> it does navigate them to the other record but clearly this is a non-runner in terms of useability (and they can still choose to save the record first anyway).

Is there any way for me to achieve the programmatic navigation to another CRM contact record whilst already being in a CRM contact form in creation mode?

I can't seem to find any way to hide that default dialog.

 

The only workaround I can think of is to actually do the save in the background, whilst setting some kind of deletion flag. And I then delete it subsequently straight away afterwards.

But that seems very messy.

Any ideas?

Thanks

I have the same question (0)

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 96 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans