Compare Base Components
Compare lightning-record-*-form
components
to find the one that meets your use case.
These components provide a form layout. Field labels use values that are based on the default values in your org. The components handle record create, read, and update changes without requiring Apex code. They use Lightning Data Service to cache and share record updates across components.
lightning-record-edit-form
—Displays an editable form.lightning-record-view-form
—Displays a read-only form.lightning-record-form
—Supports edit, view, and read-only modes.
Feature | lightning-record-form |
lightning-record-view-form |
lightning-record-edit-form |
---|---|---|---|
Create Records | |||
Edit Records | |||
View Records | |||
Read-Only Mode | |||
Layout Types | |||
Multi Column Layout | |||
Custom Layout for Fields | |||
Custom Rendering of Record Data |
For most use cases, lightning-record-form
provides a
great starting point. It combines and simplifies the functionality of lightning-record-view-form
and lightning-record-edit-form
.
Specify either a layout type or the fields and the mode, and the component takes care of
layout, validation, CRUD changes, and error handling. The lightning-record-form
component also switches from edit mode to view mode
after changes are submitted successfully.
For more advanced use cases that require custom field layouts and custom rendering of
record data, use lightning-record-view-form
and
lightning-record-edit-form
.
If you need more customization than the base components allow, such as a custom user interface, see Build Custom UI to Create and Edit Records and Get Record Data.
No comments:
Post a Comment