
Hello!
I am currently working with trying to prevent duplicate emails being pushed to our system by using a custom field that my team has created and the "From" field in the Email entity.
The instructions I've been following are from this website here: https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/manage-duplicate-detection-create-update
I have created a duplicate rule that is able to find duplicates based on if the Custom Field is populated (where I ignore blanks and only do detection on rows that have this value populated) and the From field. When I run a Duplication Detection Job, it is is able to find duplicates and published this Duplication Detection Rule.
I have also enabled the Duplication Detection section in the Email Entity:
When I attempt to add an email via WebAPI call with the following headers:
OData-Version: 4.0
OData-MaxVersion: 4.0
Content-Type: application/json
Accept: application/json
MSCRM.SuppressDuplicateDetection: false
It still continues to allow duplicates into the system. I believe there is something wrong with the Duplication Rule that is allowing these emails to not be picked up, but I'm unsure of why it is not configured correctly.
I cannot use an alternative key because there are emails that will not have this custom field published and it is possible to have get false positive of emails that are duplicates.
Any insight on why this would be happening would be helpful.
Hi Partner,
I test in my instance and it did create duplicate record without the rule triggered.
I think it may caused by the assignment way.
As we know, From is a party list field and when we pass the api request to D365, it does not show as "From", it show as "partyid_systemuser@odata.bind" which may leave the rule unrecognized.
I suggest that you could create a custom lookup field related to system user and when choose sender from it, assign the value to From field at the same time. Then you just need to duplicate this custom field and it will work both in D365 and web api.
Regards,
Leo