Lightning Data Service (LDS) is a declarative service that allows you to access, modify or create data in Salesforce, most of the time without server-side code.
lightning/ui*Api
APIs, LDS creates wrappers for developers to use it in a more friendly way.<aside> 👉 LDS does not support External objects, person accounts, and custom metadata types are not supported.
</aside>
You have 3 different options to work with LDS:
@wire
decorator@wire
decoratorThe full schema is:
**Acccesing Data from LWC**
|--- 1. Base Components
|--- 2. Preconfigured adapters with @wire
| |--- 2.1 Decorating a property with @wire
| |--- 2.2 Decorating a function with @wire
|--- 3. Custom Apex
|--- 3.1 Wired to a property
|--- 3.2 Wired to a function
|--- 3.2 Call imperatively
This is the easiest way to work with records. These components provide a UI to view, create, and edit recorda, similar to the record detail page in Salesforce.
<aside> 📢 Using the Base Components is explained in detail here: Using Base Components
</aside>
There are 3 base components:
lightning-record-form](<https://developer.salesforce.com/docs/component-library/bundle/lightning-record-form/documentation>):
edit, view and read-only modes based on defined layouts.lightning-record-view-form
: displays a read-only form using custom layouts.lightning-record-edit-form
: displays an editable form using custom layouts.