0

We have a scenario where we want to prevent users from creating duplicate contacts but want to allow users to be able to create the same contact with same details if its on a different account.

What I have done is created a flow so that it updates the field (Associated_Account__c) before it is saved. My flow will checks if the contact has an account associated

If it does it will add the account id to it

if it doesn't it will add 'No account'.

On my duplicate matching rule I have these conditions set

Email(exact match) phone (fuzzy match) Associated Account__c (exact match)

The idea behind this idea is if there are no accounts attached to it they should have 'No Account' and if the phone and email are the same the duplicate rule will flag it and prevent users from creating it.

If there is an account attached to it and because every account has a unique id they should be able to create the contact.

My problem Im having is when i test and try and create the same contacts without an account attached to it the duplicate rule doesn't fire. I am assuming because the field isn't being updated by the flow even though i have it set to update before saving the record.

Am I going about this the correct way or should I have a different approach? I would like to try and code this but I dont know how.

If its simple I would like to have a crack at it.

Thanks

4
  • 1
    The Flow's Update record element causes DML to occur so per Triggers and Order of Execution, the Duplicate Rules will fire at step 6. I'm assuming these are configured to be block and activated. Check how you are handling Match blank fields in your Matching Rules. Use edit to elaborate on what you have set up
    – cropredy
    May 3, 2022 at 0:47
  • Hello, What did you mean by block and activated? May 3, 2022 at 2:03
  • 1
    Each duplicate rule either blocks or alerts on dups. The rule has to be active.
    – cropredy
    May 3, 2022 at 2:17
  • ah yep i'm with u know thank you May 3, 2022 at 2:21

0

You must log in to answer this question.

Browse other questions tagged .