Record Edit

force:recordEdit

Generates an editable view of the specified Salesforce record.

For Use In

Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out (Beta), Standalone Lightning App

This component has been superseded by lightning:recordEditForm. Alternatively, use lightning:recordForm if you want to switch between view and edit modes easily.

A force:recordEdit component represents the record edit UI for the specified recordId.

This component displays fields in the order they appear on the corresponding page layout and record details page. If you want granular control over displaying of specific fields, we recommend using lightning:inputField instead.

This example displays the record edit UI and a button, which when pressed saves the record.

This client-side controller fires the recordSave event, which saves the record.

You can provide a dynamic ID for the recordId attribute using the format {!v.myObject.recordId}. To load record data, wire up the container component to an Apex controller that returns the data. See Working with Salesforce Data in the Lightning Aura Components Developer Guide for more information.

To indicate that the record has been successfully saved, handle the onSaveSuccess event.

This component doesn't fully use the Lightning Design System styling. The layout elements use Lightning Design System styling, but the input fields do not. Use lightning:recordEditForm if you want a component that inherits the Lightning Design System styling.

On desktop, the Image button on the rich text editor opens the Select Image dialog, which enables you to select an image available in your Files Home. You can also upload an image from the Select Image dialog. Selecting an image is not supported in Lightning Out and standalone apps. To display a record form with a rich text editor that uses the system file selector, use lightning:recordEditForm instead.

On mobile devices, the rich text editor uses the native file selector.

recordSave

User fired event to indicate request to save the record.

onSaveSuccess

The event fired when the record is saved successfully.