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

Delete Record

The Delete Record interaction permanently removes a Salesforce record directly from your Dynamic Component.

Overview

The Delete Record interaction allows you to permanently remove a Salesforce record directly from your Dynamic Component. This interaction requires a Record ID to identify exactly which record to delete.

This action is irreversible within the component (though the record may go to the Salesforce Recycle Bin depending on your org's settings).


Configuration

To perform a delete operation, you must specify which record you want to remove. You can identify it from a Record Variable, from the record currently displayed on the page, or by entering a record ID manually.

Method 1: Deleting 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 provide a button to delete the record currently being viewed.

1. Define the Context

  • Open your Dynamic Component's Settings (gear icon ⚙️).

  • Set the Target Page Object to the object you are working on.

  • Result: The $Component.record variable is now active and holds the ID of the current record.

2. Configure the Interaction

  • Add a Button component (e.g., label it "Delete").

  • Add an On Click interaction.

  • Action Type: Select Delete Record.

  • Record Variable: Select Target Page Record.

Method 2: Deleting a Specific Record Variable

Use this method when you want to delete a record that is not the main record of the page (e.g., deleting a specific row from a list of related contacts, or a record fetched via a "Get Records" action).

1. Identify the Variable Ensure you have a Record Variable (e.g., selectedContact) that is currently populated with data. This is often done by:

  • Using an On Load > Get Records interaction.

  • Using an Iterator or Collection where the user selects a specific item.

2. Configure the Interaction

  • Add the interactive component (e.g., a "Trash" icon button inside a list or card).

  • Add an On Click interaction.

  • Action Type: Select Delete Record.

  • Record Variable: Select the specific variable you want to delete (e.g., {!selectedContact}).

Method 3: Entering a Record ID Manually

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

  • Add an On Click interaction.

  • Action Type: Select Delete Record.

  • Record Variable: Select Enter record ID manually.

  • Record ID: Provide the Salesforce record ID to delete.

The Record ID Requirement

For the delete action to work, the variable you select must contain the Salesforce Record ID.

  • Context Record: The system automatically includes the ID.

  • Custom Variable: If you populated the variable using a query (Get Records) or a Flow, you must ensure the Id field was included in the retrieved data.

On Success and On Error

The Delete Record interaction lets you chain follow-up interactions for each outcome. Accepted follow-ups for both On Success and On Error are Show Toast, Refresh All Queries, Refresh Query, Get Record, and Assignment.


Example

If you delete the Current Page Record (Method 1), the user will be left on a page that no longer exists. You should chain a Navigate interaction immediately after the delete action to redirect the user elsewhere (e.g., back to the Object Home page or a parent record).

Example Chain:

  1. Delete Record: (Target Page Record)

  2. Navigate: (To Opportunity List View)


Important Considerations

Because deleting data is a destructive action, it is highly recommended to ask for user confirmation before triggering the delete.

Recommended Flow:

  1. Button Click: Triggers an Open Modal (or Open Alert) interaction asking "Are you sure?".

  2. Modal "Confirm" Button: Triggers the Delete Record interaction.

Last updated

Was this helpful?