How to Create Reparenting Rules

OneMerge Training – How to Create Reparenting Rules

Option1 – Guided Setup

To create Reparenting Rules, follow these steps:  

  1. From the OneMerge Application Home page, click Guided Setup in the footer.
  2. On the first screen select the Setup Action Manage Merge Rulesets, and click the Next button.
  3. On the next screen select Standard Merge Ruleset for Accounts, select Edit the Selected Setting and click the Next button.
  4. On the next screen select Manage Reparenting Rules, and click the Next button (as shown below).
  5. On the next screen select Create New, and click the Next button.
  6. On the next screen, enter label, Salesforce Object, Reparenting Action, and click the Next button (click Is Active? to activate).
  7. On the next screen, enter Original Field Name, Master Field Name, and click the Next button.
  8. On the next screen, select Save and click the Next button.
  9. The next screen displays a validation table, click the Finish button.

Option 2 – Custom Metadata Type

To create a new Reparenting Rule, follow these steps:

  1. Open the Salesforce Setup menu.
  2. Select Custom Code>Custom Metatdata Types.
  3. Click the Manage Custom Reparenting Rules link.
  4. Click the New button (the screen displayed should be as below).
  5. Enter the Reparenting Rules and click on the Save button.

The fields available to complete are: 

Information 

  • Label = Name of the Reparenting Rule  
  • Custom Reparenting Rule Name = Automatically populated with the API name  
  • Merge Ruleset = Search for the Merge Ruleset the Reparenting Rule applies to 
  • Merge Object Mapping = This needs selecting when the reparenting rule applies across different Objects 
  • Is Active? = If TRUE, then the rule will be processed the Reparenting Rule is processed by merge or reparenting operations 

Reparenting Information 

  • SObject Type = This is the object that will be reparented to the Master Record  
  • Master record Field Name = This is the API name of the Master Record relationship field 
  • Original Record Field Name = The API name of the Original Record relationship field 
  • Reparenting Action = This relates to the child record. You can select here to either: 
    • Update = The reparenting rule will update the Master Record with the Child Record information 
    • Update and Blank = The reparenting rule will update the Master Record with the Child Record information and then delete (blank) this information on the Child Record 
    • Clone and Retain = The Child Record will be cloned to create the Master Record 
    • Clone and Delete = The Child Record will be cloned and then deleted 
    • Clone if Required = The Child Record willbecloned. 
    • Is Immediate? = TRUE then the reparenting rule will be processed by the Merge operation up to the limit of the next field 
    • Immediate Record Limit? = The number of related records processed by immediate reparenting 

The following provides an example scenario where Cases on Contacts will be Reparented to the Master Contact Record created in a Duplicate Record Group: 

  • Label = Contact Cases 
  • Custom Reparenting Rule Name = Contact_Cases 
  • Merge Ruleset = Standard Merge Ruleset for Contacts 
  • Is Active? = TRUE  
  • SObject Type = Case 
  • Master Record Field Name = ContactId 
  • Original Record Field Name = ContactId 
  • Reparenting Action = Update 
  • Filter Operator = None

When matching Contact Records are merged and the Source Records contain Cases, the Cases will be Reparented to the Master Record. 

Article last reviewed: 2024-04-10