Preventing duplicate junction object records
Native dupe management only allows you to reference a single lookup field. So it cannot prevent duplicate junction object records.
By using a (new in spring 20) before save flow to concatenate the two IDs into a single text field, you can prevent duplicate junction object records.
This cannot be done with workflow rules, because of the order of operations. Dupe rules are evaluated at step 6, and workflow at step 11 (as of Feb 2020)
Here are the steps
- create a text field named Compound Key on your junction object
- create a flow
- click on the start button and set the flow to launch on ‘new or updated records’ (you can decide if it fires on insert, update, or both)
- add an assignment element that sets Compound Key to a formula field which concatenates the two ID fields on the record
- create and activate a matching rule that matches on Compound Key (exact)
- create and activate a dupe...






