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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156