How to clone a record with its related records in Salesforce
The short answer: To clone a record with related records in Salesforce, use the Clone with Related action. Salesforce Help documents it for Opportunities (contact roles, products and product schedules) and Campaigns, in Lightning Experience only. For other objects, build a Flow that copies the children. Either way, reset the dates, stage, owner and unique fields on the copy, because Clone copies what’s there.
The renewal rep wants last year’s Opportunity: same products, same contact roles, none of the old notes. She finds Clone, clicks it, and gets a record. The Close Date says March. The Stage says Closed Won. The products didn’t come, so she re-adds nine of them by hand and forgets the tenth.
Nothing is broken. Clone did what it was built to do. The trouble is that “a copy” and “a new deal” are different things, and the gap between them is where the stale data comes from.
What does the standard Clone button copy?
It copies field values from the record you are on into a new record, and only the fields that record page shows. Salesforce Help says which fields are copied depends on how the record page is configured: with the Record Detail component, fields come from the page layout, and with Dynamic Forms, from the field sections on the original page.
Help lists what comes out blank:
- Fields you don’t have access to.
- Fields you have only read-only access to on the record you’re cloning.
It also says you need Create on the object and Read on the record. Clone itself is available in Lightning, Classic and the mobile app, per the Opportunity considerations article, but related records are a separate step.
One audit-field quirk: per a Salesforce knowledge article, a user with the Set Audit Fields upon Record Creation permission can end up with the original record’s Created Date on the clone in Lightning.
Does Salesforce have Clone with Related, and for which objects?
Yes, for some objects. Salesforce Help documents Clone with Related for Opportunities and Campaigns. The Spring ’20 release brought it to Opportunities: Salesforce’s blog says cloning an opportunity now lets you also copy contact roles, products or product (line item) schedules.
The details worth knowing, all from Salesforce Help:
- It is Lightning Experience only, and it isn’t available in the Salesforce mobile app. Editions: Professional, Enterprise, Performance, Unlimited and Developer.
- The admin adds the action to the page layout, as the Spring ’20 post describes for Opportunities.
- You can include up to 999 related records in total, cloned in batches of 200. Validation rules, Apex triggers and workflow run separately for each batch.
- For campaigns, you can clone related records such as campaign member statuses and, if you use Account Engagement, some of its assets. Some fields change or come out blank in the copy, such as the new campaign and asset IDs.
- A related record with a custom field that must be unique needs that value deleted before you clone it.
Help’s general Clone Records article doesn’t list every object that offers Clone with Related, and the product clone article describes copying a product with its price book entries rather than a related-records picker. If your object isn’t in the documented list, check the actions available for it in Object Manager before you assume it exists.
How do you clone related records with a Flow?
Build a screen Flow that creates the new parent, then loops through each type of child and creates copies pointed at the new parent. A write-up from Salesforce Time, a community blog, builds exactly this for Cases: a screen to adjust a few fields, checkboxes for which children to copy, then Get Records, Loop, Assignment and Create Records for each child type.
The shape, in plain steps:
- Pass the record in as an input variable, so a quick action can launch the Flow.
- Show a screen with the fields people may change, defaulted to the current values.
- Create the new parent from only the fields you map. Anything you don’t map isn’t copied, which is how you leave out the Id and the fields that shouldn’t travel.
- For each child type, use Get Records to fetch all matches, loop through them, set the parent lookup to the new parent’s Id, and add each to a collection.
- After the loop, create the whole collection in one Create Records element, not one record at a time inside the loop.
- Add the Flow to the page as a quick action.
A record-triggered Flow can also do the copying, but as the same article notes, it can’t show a screen, so the user can’t choose which children to copy. The child types must be decided in advance.
The cost shows up later, and I’d call it the real price of this approach. Each object gets its own Flow. Each child type is another branch. A new field added to the object next quarter is silently left off the copy until someone remembers to add it to the Flow. If you build one, write down which fields it maps and which it deliberately skips. Flow’s own version history won’t remember your intent for you either, and we plan a post on Flow edit history for tidying them.
What goes wrong when you clone, and what should you reset?
Most clone problems come from carrying forward something that was true for the original and isn’t true for the copy. Reset these on the way, whether by Flow, by training or by rule.
| Field | Why it goes stale | Reset to |
|---|---|---|
| Name | Two records called the same thing | Add the year, “Renewal” or the cycle |
| Close Date or any “due” date | The copy keeps last cycle’s date, so it looks overdue or already won | A real future date, or blank |
| Stage or Status | A copy of a Closed Won deal is a Closed Won deal | The first stage of the process |
| Probability, Forecast Category | Usually follows stage, but not always | Check that it follows the new stage |
| Owner | Might not be the person who will work it | The person who will work it |
| Amount, quantity, price | Last year’s price is not this year’s | Re-check against the current price book |
| Description, next steps, notes | Old conversation, sometimes about a different year | Blank, or a fresh template |
| Type (New versus Renewal) | A renewal still labeled New distorts reports | Renewal, if that’s what it is |
| Contract numbers, external IDs, integration IDs | A unique value on two records fails on save, or worse, syncs as a duplicate | Blank, or generate a new one |
| Approval status, signed flags, document links | Looks approved when nobody approved it | Not submitted, unchecked, blank |
Two more traps. First, fields not on the page layout may not come along, and read-only fields come out blank, so a copy can be missing values that nobody reset on purpose. Second, a clone runs your validation rules and triggers like any other create, so a required field that the original filled in another way can block the save. That is annoying and also correct.
What to do Monday:
1. Pick the object your team clones most and write down which fields need resetting, using the table above.
2. Open its page layout and check whether Clone with Related is there. If you clone Opportunities and it isn’t, add it, then test with a record that has products and contact roles.
3. If there is already a clone Flow, list what it maps and what it skips, and add any field created since it was built.
4. Ask three reps how they really clone. The answers will differ.
Where we come in
Sistership, by GTM Cloud, is in early access. It is a second way to clone: rules blank, set or protect fields on the copy, you choose which related records come along, and a log shows what changed. The standard Clone button stays as it is, so decide which one your layouts offer. There’s no undo, because a clone is a new record: delete the copy. See the Sistership page.
Questions people ask
Does the Salesforce Clone button copy related records?
No. The standard Clone button copies field values to a new record, not its children. For Opportunities and Campaigns, Salesforce Help documents a separate Clone with Related action that lets you pick related records to copy. Everything else needs a Flow or custom code to bring children along.
Why does my cloned record have the old close date or stage?
Because Clone copies the values it finds. Salesforce Help says fields are copied according to the page layout or form on the original record, so nothing resets the date or stage for you. You need to change them by hand, in a Flow, or with rules that run when the copy is created.
Is Clone with Related available in the Salesforce mobile app?
No. Salesforce Help says Clone with Related isn’t available in the Salesforce mobile app, and the Opportunity article says it is in Lightning Experience only. The plain Clone action is available in mobile. If reps clone from their phones, plan for the difference.
Sources
- Clone Records, Salesforce Help: fields copied by page configuration, blank fields, permissions, editions, mobile, 999 and 200 limits.
- Considerations for Cloning Opportunities, Salesforce Help: Lightning-only Clone with Related, read-only and unique fields, batching.
- Clone a Campaign with Related Records, Salesforce Help: which campaign related records can be cloned, field handling.
- Considerations for Cloning Products, Salesforce Help: product clone copies price book entries.
- Spring ’20 features, Salesforce blog: contact roles, products and schedules on opportunity clone, admin adds the action.
- Cloning copies the original Created Date, Salesforce Help: audit-field permission quirk.
- Using Flow to clone a record with its related records, as written by Salesforce Time: the screen Flow pattern and record-triggered limitation.