Scenario:(I have translated it to accounts & contacts, actually are custom objs)-
I have decided that the contacts with the same name under are account are duplicated. Hence I have written a trigger on contacts, before insert & before update, to weed out those duplicate contacts by comparing them with existing contact records. Then I create a List that contains non duplicate contact records and it is then this list I use for the remaining processing in the contact trigger.
Now I have decided to use the salesforce duplication rules to do the deduplication rather than the trigger(Owing to increasing records in the system). But if I do it, then I lose the deduplicated List that I was using in the rest of the trigger. Since duplication rules run only after the before trigger is executed, all the entries in trigger.new( even duplicates) will be considered in trigger.new.
Is there anyway I can prevent the trigger from operating on the duplicate records in trigger.new, if I leave the deduplication part to duplicate rules and not the trigger?
PS : Moving the before insert & before update functionalities to after trigger is not a good design since, I am updating the trigger.new in some of those methods.
Thanks in advance