Skip to content

rallenssg/sf-merge-event-handler

Repository files navigation

Modular Record Merge Custom Platform Event

Description

The custom Merge Event object can be used on any object by triggering Apex after delete and in the case of a delete, in a Handler class, check if the MasterRecordId on the deleted record is not null, indicating a merge. If populated, create new MergeEvent__e record populating the ObjectName__c, current time for MergedAt__c, the delted record Id for MergedRecordID__c, and the MasterRecordId from the deleted record for MasterRecordID__c.

Account is provided for example in this project.

Components

Custom Platform Event

MergeEvent__e

Fields:

ObjectName__c: Text(255)
MasterRecordID__c: Text(18)
MergedRecordID__c: Text(18)
MergedAt__c: DateTime

Apex

AccountTrigger
AccountMergeEventHandler
AccountMergeEventHandlerTest

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published