Dynamics CRM

CRM 2011 – Did you know: Your Duplicate Detection Rules Can and Will Unpublish Themselves

The Duplicate Detection feature in CRM 2011 is a great tool. The problem I’ve been having with it recently is that the rules have been spontaneously Unpublishing themselves. Or so I thought. As you might imagine this was causing us data quality issues and is not really what you want from a key feature.

It turns out, Duplicate Detection Rules are set to Unpublished whenever you Publish a Managed or Unmanaged Solution involving one of the entities referenced in the rule:

So, you can and will go from this:

Duplicate Detection Published

to this:

Duplicate Detection Off

Simply by making routine changes to your system. Not very cool, but at least I now know what’s going on here.

When will it happen?

Unfortunately its not quite as simple as saying that if you make any change to say the account, then related Duplicate Detection Rules will be unpublished. It’s a little more subtle than that.

This may well have changed in CRM 2013 but in my environment the following changes do not cause Duplicate Detection Rules to be unpublished:

  • Modifying a relevant Form without exporting/importing a solution. i.e. doing a straight Customize->Form on the entity in question without going through a solution
  • Adding a field to the entity, again not using a solution
  • Deleting a field, not using a solution (though presumably you would be stopped from deleting a field that Duplicate Detection explicitly depended on).

So when does the issue occur? This is the interesting part  – Duplicate Detection Rules will be unpublished if you import a solution containing a relevant entity even if you have changed absolutely nothing in the entity.

You can test this fairly easily. Set a rule up on the account entity, export a solution with the account entity in it and reimport it without making changes. You detection rules will have been unpublished.

It’s clearly a simple switch that says if you import a solution that even hints at involving a relevant entity – the rules will be unpublished.

Something to be aware of if you depend heavily of Duplicate Detection and make frequent changes to your system

Cheers

Advertisements

4 thoughts on “CRM 2011 – Did you know: Your Duplicate Detection Rules Can and Will Unpublish Themselves

  1. Thank you very much for this blog post. I’ve been pulling my hair out trying to figure out why the rules keep getting unpublished! At least now I can add it to my growing sanity checklist I run through after an update/upgrade/installation.

    It may be asking too much but, why the #*#*& isn’t this documented by Microsoft? If it is, I couldn’t find it anywhere.

    1. Hi Eric

      I’m really glad it helped. In terms of documentation – I think I actually figured it out by trial and error! Not pretty and you’re right – it is a pretty glaring problem that should be highlighted more!

      Best Regards

      S

  2. Hi,
    also thank you for this issue Explanation!
    Since then, is there any known workaroundfor this when Solutions must be used and often imported to the target System?
    Besides we have another effect too: The rule it self does not work properly anymore, e. g. does not raise in new or edit forms and the duplicate is created without Problems (although rule is published). Can this be due to the described effects or is this mainly another reason? I maybe thought of SQL index regionalisation or maybe the encryption of the database, or or ….any ideas on this?
    Thanks, Uli

    1. Hi Uli

      I dont know of an “easy” workaround for systems with lots of solution imports. We just handle it manually, but if it became a problem it might be that it could be handled via a workflow or plugin. I’m not sure if there could be a type of system job that runs on solution import that a workflow could be hooked on to. Failing that it would be bespoke code using the SDK I’m afraid. I’m almost certain I’ve seen examples of how to publish detection rules via code

      I havent seen any examples where the detection rule fails to apply though. If its causing big issues, if you could recreate the problem in a test org, Microsoft might offer a hotfix or already know what’s going on.

      HTH

      S

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s