Lightning Data Service in LWC

In this post we are going to discuss about lightning data service in lightning web components.
Lightning data service is a collection of lightning methods and events so it’s nothing but similar to a standard controller in visualforce page.
So you don’t have to write any code to load,create,edit or delete the record in your component.

Lightning data service is built on the top of user interface API. This user interface API is used by the Salesforce to build the
lightning experience and to host the Salesforce on to the mobile devices like Android and iOS. Also lightning data service caches the results on a
client and thus reduces the server trip. It invalidates the cache entries when whenever the dependent Salesforce data or a metadata
changes in one of the components.

Also lightning data service respects the crud access field level security and sharing settings for particular user. Suppose a particular user is
using your component and it does not have FLS for that particular fields or crud access for a records he/she will not be able to see display the record

In lightning web component we can implement lightning data service @wire decorator or
we can implement using lightning record form, lightning record view form or lightning record edit form we have discussed already at the @wire adapter
in one of our previous posts so we are going to discuss :
–lightning record form
–lightning record view form
–lightning record edit form

These are the base lightning components which binds/wires your form to aSalesforce object.
The Lightning record form kind of displays a standard layout whereas if you want to apply certain designing on the fields present in your form then you can use lightning record form, lightning record view form or lightning record edit form.

Please check below video for detailed explaination with examples:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s