web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Duplicate Detection and Pre-event problem

(0) ShareShare
ReportReport
Posted on by

Hi, I have just discvoered that the Duplicate Detection 'process' combined with any callout pre-event on an entity causes the 'save anyway' to simply dissapear and no record is created.

We have a customer that is using a pre event to generate a business specific account number based on the SDK accountnumberid generator. I have duplicated this on a virtual image using the SDK compiled code and using the latest Rollup 10.

CRM duplicate detection is working perfectly. The custom callout is working perfectly.  If there is no duplicate to detect, everything works perfectly. The pre-event and DD combined fails to create any record.

Is there some way that the pre-event callout can cater for the duplicate detection? I assume that others have discovered this and have a way to work around it as it is a common scenario?

*This post is locked for comments

I have the same question (0)
  • Wayne Walton Profile Picture
    13,730 on at

    Are your dupe detection rules set up correctly?  It seems to me that they're doing what you ask them to do, and it might be worthwhile to refine them so this action doesn't spawn dupe detection alerts.

    Can you provide more details?

  • Community Member Profile Picture
    on at

    Hi Wayne, Thanks for the reply. They are the standard rules for 'e-mail address' and Name. The customer has times where an Account or Contact will have the same e-mail address so they want to save anyway - on other occasions they will see that the record is a true duplicate and will cancel the creation of the new Account or Contact.

    The Duplication detection is indeed working as it should be and as expected. It looks to me as though the pre-event callout 'casues confusion' when the Duplicate Detection form opens or process occurs. Kind of like a break in the assumed platform logic. I read a post where someone was having trouble with a JavaScript OnLoad with the same effect. In that case the person moved the JS from the OnLoad. We can't do that with the callout as it is generating an Account Number.

    The unmodified complied code from the SDK: sdk\server\fullsample\pluginpreaccount\cs\ does the same thing as the customer is seeing.

    With the Dupe Detection ON the default e-mail address field and the Custom Callout enabled this is the process

    Create New > Fill in fields with dup e-mail > Save > 'Fails' and Dup Detect form Opens > Press 'Save Anyway' - nothing happens, no error, no record created.

    I will apply the SDK Code to a Clean install and see if the issue exists from an out-of-box deployment.

    Hope all this makes sense...

     

  • Community Member Profile Picture
    on at

    Update and I hope this really helps someone else (I double checked and dupe detection was only on e-mail address as default):

    1] The issue still occurs on a clean, default CRM with ONLY the SDK code applied. However, in this environment the Account form stayed open and allowed the issue to be seen.

    2] The issue is that the Pre-Event triggers for a second time as you try to 'Save Anyway'. Unfortunately the 'Account Number' is sitting there from the initial create pre-event. In the SDK Code there is a check to see if a user has manually entered the Account Code and pops an error to the user saying 'Sorry, Only the system can create an Account Number'. This left the form Open and unabled to be saved. This is a valid check in the code - just forgot to cater for the duplication process...

    3] The Solution - Still testing but - Make the field Read Only (it is on our customers CRM anyway) and comment out the Else statement check and update the .dll.

    This is now working and creating Accounts with Account Numbers AND Detecting duplicate e-mail addresses AND saving after the duplicate detection trigger. Simple in the end. Feel free to respond if this solution raises any issues I have not thought of.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Varsha deshpande Profile Picture

Varsha deshpande 5

#2
JS-09031509-0 Profile Picture

JS-09031509-0 3

#3
Ciprian  P Profile Picture

Ciprian P 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans