I have a custom object with the following fields:

  1. active__c (Checkbox)
  2. value__c (Text)

I want to make sure there are no two active records that have the field value__c populated with the same data, so I tried using duplicate rules.

I added a matching rule that matches iff the data in value__c is the same and then I added a duplicate rule that uses that matching rule with the condition that active__c is true. This duplicate rule is set to block on creation and on edit if a duplicate is found.

This does not work as I want it though. For reproduction you can do the following:

  1. create two records
  2. set active__c to false on both
  3. set value__c to abc (or any other string) on both.
  4. set active__c to true on one of them.
  5. set active__c to true on the other one too.

The duplicate rule does not execute despite the fact that there are now two active records with the same value.

This seems like a bug to me, but if not, is there a way to do this using duplicate rules?

If there is not, are there any other standard functionalities I can use?

I want to try to solve this without using apex, flows, processes or workflows since they need a little more maintenance.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.