CRM 2013 SP1 Duplicate Detection Bug – Really a bug or expected framework behavior?

As many of us know, with CRM 2013 SP1, duplicate detection is back. Personally I liked it a lot because you can avoid potential duplicates just through configuration without writing plugins and also you get an option to continue with the duplicate record or to perform actions like merge on the duplicate records,

So came the requirement – “There should not be two records with the same field value in the same business unit” . So simple isn’t it. Happily i went ahead and suggested to apply OOB duplicate detection rules for this requirement. But my happiness was short lived. Lets us see why.

I have created a custom entity called ‘DupDetect’ for this demo. There is field called ‘Dup Field’ in this entity. To put the above requirement for this demo, there should not be two records with the same value of ‘Dup Field’ in the same business unit. So i went ahead and created the following duplicate detection rule and published it.

image

Now i move to entity and as you can see in the screenshot below, there is one record of DupDetect Entity with Dup Field value of ‘Dup 1’ owned by me.

image

Now i create one more record with the same ‘Dup 1’ in Dup Field and strangely the system does not show up any duplicates warning. As you can see below, there are two records with the same value for Dup Field and with me as the owner.

image

Well fine. duplicate detection did not work during create. I then thought of checking for update. I tried to change both the values for Dup Field to “Dup 2”. And voila now it shows a duplicate.

image

So I am not sure whether this is bug or not. My understanding is that during create when the duplicate detection is fired from the framework, the owningbusinessunit of the userid is still not deduced because owningbusinessunit of the record is deduced from the owner of the record. Hence did not show the duplicate detection pop-up. This is just my assumption and I would have to like your ideas on this.

 

Thanks for reading!