# Record Detail

## Overview

The Record Detail component is designed to work with *one* Salesforce record at a time. Key features include:

* **Multiple Layout Options:** Display fields using standard Salesforce layouts (Compact or Full).
* **View and Edit Modes:** Control whether the fields are read-only or editable.
* **Required Fields:** Mark specific fields as required (when in edit mode).
* **Data Binding:** The component automatically fetches and displays the record data based on a provided Record ID.
* **Saving Changes:** To save changes to Salesforce, use the interactions tab. [Learn more](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/record-detail/saving-changes).
* **Conditional Visibility:** The component supports conditional visibility.

## Configuring the Record Detail Component

Select the Record Detail component on the canvas to access its properties in the Properties Panel.

### Properties

These properties *must* be configured for the component to function:

* **API Name:** (Text) A unique identifier for this component instance (e.g., `AccountDetail`, `ContactDetail`).
* **Object API Name:** (Text) The API name of the Salesforce object you want to display (e.g., `Account`, `Contact`, `My_Custom_Object__c`). This determines which object's fields are available.
* **Record ID:** (Text) The 15 or 18-character ID of the *specific record* you want to display.
  * **On Record Pages:** If your Dynamic Component is on a record page, you'll almost always bind this to a record variable or use the `$Component` attribute if you have configured any [Target Object Page](https://docs.avonnicomponents.com/dynamic-components/getting-started/understanding-the-essentials/target-page-object) in your Dynamic Component.
  * **Other Contexts:** You can also bind the Record ID to a Variable resource (e.g., if you're getting the ID from a URL parameter or from another component).

### Layout Options

* **Layout Type:** (Text - Select from options) Choose how the fields should be displayed:
  * `Compact`: Uses the object's *compact layout* (defined in Salesforce Setup). This is a concise, pre-defined set of fields.
  * `Full`: Uses the object's *page layout* (defined in Salesforce Setup). This shows all fields included in the page layout.

{% hint style="warning" %}
**The Custom View feature** is not available at this time. We plan to include it in a future update
{% endhint %}

### Display Mode

* **Mode:** (Text - Select from options) Determines whether the fields are editable or read-only:
  * `View`: Fields are displayed as read-only. Users cannot modify the data directly within the component. You can optionally enable *inline editing* (see below).
  * `Edit`: Fields are displayed as editable input fields. Users can directly modify the data.
* **Inline Edit**:(Boolean) Enable inline edition when the mode is set to View.

### Saving Changes (Interactions)

The Record Detail component itself *does not automatically save changes* back to Salesforce. You need to add an *interaction* to handle saving.&#x20;

This is typically done with an interaction

{% content-ref url="../tutorials/components/record-detail/saving-changes" %}
[saving-changes](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/record-detail/saving-changes)
{% endcontent-ref %}
