Ora

How do I clone related records in Salesforce?

Published in Salesforce Data Management 6 mins read

Cloning related records in Salesforce allows you to quickly duplicate a parent record along with its associated child records, significantly streamlining data entry and saving valuable time.

Understanding Cloning with Related Records in Salesforce

The "Clone with Related" feature in Salesforce is a powerful tool designed to replicate a primary record and selected associated (child) records simultaneously. This functionality is particularly useful for common business scenarios where you need to create new records that share many characteristics with existing ones, such as:

  • Opportunities: Duplicating an opportunity along with its products, schedules, or contact roles for a new sales cycle or a follow-up deal.
  • Campaigns: Recreating a marketing campaign with its associated campaign members for recurring events or similar initiatives.
  • Custom Objects: Extending this capability to your unique business objects to replicate complex data structures.

This process reduces manual data entry, minimizes errors, and ensures consistency across similar records.

Enabling the 'Clone with Related' Action

Before you can use the "Clone with Related" functionality, a Salesforce administrator must add this action to the relevant object's page layout. This ensures that the button appears for users when they view a record.

Here’s a step-by-step guide to setting it up, often done for standard objects like Opportunities or Campaigns:

  1. Navigate to Setup: From within Salesforce, click the gear icon (⚙️) in the top right corner and select Setup.
  2. Access Object Manager: In the Quick Find box on the left, type "Object Manager" and select it.
  3. Select the Target Object: Find and click on the object for which you want to enable cloning (e.g., Opportunity or Campaign).
  4. Edit Page Layout: In the left-hand menu, click on Page Layouts. Then, select the specific page layout you wish to modify.
  5. Add the Action: In the page layout editor, locate the Mobile & Lightning Actions section. From the palette at the top, drag and drop the "Clone with Related" action into this section. You can place it where it makes the most sense for your users.
  6. Save Changes: Click Save to apply your modifications to the page layout.

How to Use 'Clone with Related'

Once the "Clone with Related" action has been enabled on the page layout, users can easily clone records.

  1. Open the Source Record: Go to the specific Opportunity, Campaign, or other record that you want to clone.
  2. Initiate Cloning: On the record's detail page, locate and click the "Clone with Related" button. This button is typically found in the highlights panel at the top of the record page or within a dropdown menu.
  3. Select Related Records: Salesforce will present a new screen where you can specify which related lists or child records you wish to include in the clone. For instance, when cloning an Opportunity, you might see options to include Opportunity Products, Opportunity Contact Roles, or Opportunity Splits. Check the boxes next to the related lists you want to duplicate.
  4. Review and Customize: A new record creation page will appear, pre-populated with data from the original record and the selected related records. This is your opportunity to make any necessary adjustments to the new record's details, such as changing the Close Date or Stage for an Opportunity, or updating the Campaign Name and Start Date for a Campaign.
  5. Save the New Record: After making your adjustments, click Save to create the new, cloned record.

Common Use Cases and Examples

Leveraging "Clone with Related" can significantly boost productivity across various departments.

Example 1: Cloning an Opportunity with Products

Imagine a sales scenario where a customer frequently reorders the same set of products. Instead of manually adding each product line item for a new opportunity:

  1. Open the existing, closed-won Opportunity.
  2. Click Clone with Related.
  3. On the selection screen, check the box for Opportunity Products (and potentially Opportunity Contact Roles if the same contacts are involved).
  4. On the new opportunity creation page, update the Close Date, Stage, and any other relevant fields for the new sales cycle.
  5. Click Save.

This instantly creates a new opportunity with all the associated products and their quantities already populated, ready for your sales team to pursue.

Example 2: Cloning a Campaign with Members

For marketing teams running recurring events or similar campaigns, cloning streamlines setup:

  1. Open a previous, successful Campaign record.
  2. Click Clone with Related.
  3. If configured, select Campaign Members to bring over the same target audience.
  4. Update the Campaign Name, Start Date, End Date, and other specifics for the new campaign.
  5. Click Save.

You now have a new campaign with the same list of members, allowing your team to quickly launch the next iteration without rebuilding the audience list.

Key Considerations for Cloning with Related Records

While powerful, there are a few points to keep in mind when utilizing this feature:

  • Standard vs. Custom Objects: Salesforce provides native "Clone with Related" functionality for many standard objects. For custom objects, this feature might require additional configuration or custom development to work precisely as needed.
  • Related List Granularity: The standard "Clone with Related" action typically offers options for specific, pre-defined related lists. For more complex, multi-level, or highly conditional cloning requirements, custom solutions (like Apex or Flows) might be necessary.
  • Field Initialization: Not all fields are automatically copied or re-initialized. Fields like dates, statuses, or unique identifiers often need manual adjustment on the new record. Always review the cloned record's details.
  • Automation Impact: Be aware that any existing automation (e.g., Flows, Process Builders, Apex Triggers) configured to run on record creation or update will execute for the newly cloned records, just as they would for manually created ones.

Enhancing Cloning with Custom Solutions

For scenarios that demand greater control or more intricate cloning logic, Salesforce developers and administrators can leverage advanced tools:

  • Apex Triggers: These can be used to programmatically control which related records are cloned, modify field values during the cloning process, or even handle cloning across multiple levels of related objects.
  • Flows: Salesforce Flows offer a declarative way to create guided cloning processes, allowing users to make dynamic choices about what to clone and how, based on specific criteria.
  • AppExchange Apps: The Salesforce AppExchange offers a variety of third-party applications specifically designed to enhance cloning capabilities, providing robust features for complex data relationships and advanced automation.
Feature Standard "Clone with Related" Custom Solutions (Flow/Apex)
Setup Complexity Easy (Page Layout configuration) Moderate to complex (requires admin/developer skills)
Related Record Depth Single-level, specific related lists Multi-level, highly customizable relationships
Field Modification Primarily manual post-clone Can automate field value changes and calculations
Conditional Logic Limited Extensive, based on business rules
Best For Simple, direct record and related list duplication Complex, dynamic, and multi-object cloning

By understanding and utilizing the "Clone with Related" feature, Salesforce users can dramatically improve efficiency and maintain data integrity across their organizations.