For the complete documentation index, see llms.txt. This page is also available as Markdown.

Duplicate Record

The Duplicate Record interaction clones an existing Salesforce record directly from your Dynamic Component.

Overview

The Duplicate Record interaction creates a copy of an existing Salesforce record directly from your Dynamic Component. Use it when you need to clone a record — and optionally modify the copy afterward — without asking the user to re-enter data.

You can identify the record to duplicate in three ways: from a Record Variable, from the record the user is currently viewing, or by entering a record ID manually.


Configuration

To duplicate a record, you must tell the interaction which record to copy.

Method 1: Duplicating a Record Variable

Use this method when the record to clone is already held in a Record Variable (e.g., populated by a Get Record interaction or selected from a list).

  • Add an On Click interaction to the triggering component (e.g., a "Duplicate" button).

  • Action Type: Select Duplicate Record.

  • Record Variable: Select the variable holding the record you want to duplicate (e.g., {!selectedContact}). The variable must be defined as a resource in your Dynamic Component.

Method 2: Duplicating the Current Page Record

Use this method when your component is placed on a Record Page (e.g., an Opportunity page) and you want to clone the record currently being viewed.

  • Add an On Click interaction.

  • Action Type: Select Duplicate Record.

  • Record Variable: Select Target Page Record.

Method 3: Entering a Record ID Manually

Use this method when the record ID comes from somewhere else — a formula, a component attribute, or a static value.

  • Add an On Click interaction.

  • Action Type: Select Duplicate Record.

  • Record Variable: Select Enter record ID manually.

  • Record ID: Provide the Salesforce record ID to duplicate. This can be a static ID or a merge expression (e.g., {!Datatable1.selectedRowKeyValue}).

Post-Action Configuration

The Duplicate Record interaction lets you chain follow-up interactions depending on the outcome:

  • On Success: The interactions to execute when the record is duplicated successfully. It is recommended to add a Refresh All Queries interaction so the new copy appears in your lists immediately, plus a Show Toast (Success variant) to confirm the action.

  • On Error: The interactions to execute when the duplication fails. Add a Show Toast with the "Error" variant so the user isn't left with a silent failure.

Accepted follow-up interactions for both outcomes are: Show Toast, Refresh All Queries, Refresh Query, Get Record, and Assignment.


Example

Goal: Let users create a new project record based on an existing "template" project.

  1. Data Table: Display Project records with a row action labeled "Clone".

  2. Interaction: On the row action, add a Duplicate Record interaction using Enter record ID manually with the row's record ID.

  3. On Success: Chain Refresh All Queries (so the copy shows up in the table) and Show Toast ("Project duplicated successfully").

  4. On Error: Chain Show Toast with the Error variant.

Last updated

Was this helpful?