Skip to main content
I'm trying to create a duplicate matching rule around a custom object (called SCR) based on two lookup rules - one to contact, and one to another custom object called Search. Each contact should only be able to have one SCR connecting them to any given search, though they can be connected (via SCRs) to many different searches. Matching rules only allow you to compare one lookup field, so I thought I would be clever and use a workflow update to update a text field to the ID of the contact, and then run the matching rule on that field and the lookup field for Search. However, despite the claim for order of execution that "If workflow field updates introduced new duplicate field values, executes duplicate rules again" https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_order_of_execution.htm , the rule doesn't run. The workflow does update the field to the correct ID - it saves it, instead of tripping the duplicate/matching rule.

 

If I manually enter the contact ID into the field that the workflow updates with the contact ID and then try to save it, the duplicate/matching rule flags it appropriately.

 

Anyone have any wisdom? I'd love any suggestion that would let me keep folks from creating (or at least flag) duplicate records of a custom object based on a match between a contact and another custom object. So far, the only things I can come up with involve a lot of button-hacking auto-population nonsense, and I'd rather not go down that road more frequently than I have to.
5 Antworten
0/9000