How to Create Reparenting Rules using Custom Metadata Types

OneMerge Training – How to Create Reparenting Rules

Reparenting Rules allow you to determine how and which Child Record information is retained on the Master Record.

Test Scenario 1 – How to Create a new Reparenting Rule for Contacts to Accounts

To create a new Reparenting Rule using Custom Metadata Types, 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.
  5. Enter the Reparenting Rules as displayed below and click on the Save button.

A new Reparenting Rule for Contacts to be reparented to the Master Account has now been created.

Test Scenario 2 – How to Create a new Reparenting Rule for Cases

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

  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.
  5. Enter the following fields values and click on Save.
  • 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

A new Reparenting Rule for Cases to be reparented to the Master Contact has now been created.

Additional Information

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 

Article last reviewed: 2023-09-26