Show:                  

DuplicateRecordItemTriggerHandler

Trigger Handler for DuplicateRecordItem
Signature
public inherited sharing class DuplicateRecordItemTriggerHandler
See
Author
Since
  • 04/19/2021 Initial Version
  • 02/28/2022 Static to instance trigger handler methods
  • DuplicateRecordItemTriggerHandler Methods

    assortDuplicateItems(newRecords)

    Assign object type and then handle all records
    Signature
    private void assortDuplicateItems(List<DuplicateRecordItem> newRecords)
    Parameters
    newRecords
    Type: List<DuplicateRecordItem>
    Trigger.new
    Author

    handleAccounts(newAccounts, recordIDs)

    Handle Accounts (may be duplicated for any object)
    Signature
    private void handleAccounts(List<DuplicateRecordItem> newAccounts, Set<Id> recordIDs)
    Parameters
    newAccounts
    Type: List<DuplicateRecordItem>
    Trigger.new
    recordIDs
    Type: Set<Id>
    AccountIDs, which are technically in newAccounts, but included for simplicity
    Author

    handleContacts(newContacts, recordIDs)

    Handle Contacts (may be duplicated for any object)
    Signature
    private void handleContacts(List<DuplicateRecordItem> newContacts, Set<Id> recordIDs)
    Parameters
    newContacts
    Type: List<DuplicateRecordItem>
    Trigger.new
    recordIDs
    Type: Set<Id>
    ContactIDs, which are technically in newContacts, but included for simplicity
    Author

    handleLeads(newLeads, recordIDs)

    Handle Leads (may be duplicated for any object)
    Signature
    private void handleLeads(List<DuplicateRecordItem> newLeads, Set<Id> recordIDs)
    Parameters
    newLeads
    Type: List<DuplicateRecordItem>
    Trigger.new
    recordIDs
    Type: Set<Id>
    LeadIDs, which are technically in newLeads, but included for simplicity
    Author

    handleTrigger(newRecords, oldRecords, newRecordsMap, oldRecordsMap, triggerEvent)

    Handle all trigger records
    Signature
    public void handleTrigger( List<DuplicateRecordItem> newRecords, List<DuplicateRecordItem> oldRecords, Map<Id, DuplicateRecordItem> newRecordsMap, Map<Id, DuplicateRecordItem> oldRecordsMap, System.TriggerOperation triggerEvent )
    Parameters
    newRecords
    Type: List<DuplicateRecordItem>
    Trigger.new
    oldRecords
    Trigger.old
    newRecordsMap
    Type: DuplicateRecordItem>
    Trigger.newMap
    oldRecordsMap
    Type: DuplicateRecordItem>
    Trigger.oldMap
    triggerEvent
    Trigger context enum
    Author

    updateDuplicateRecordSet(newRecords)

    Update the parent DuplicateRecordItem records
    Signature
    private void updateDuplicateRecordSet(List<DuplicateRecordItem> newRecords)
    Parameters
    newRecords
    Type: List<DuplicateRecordItem>
    Trigger.new
    Author