Data Guidelines for LDS

By in
409
Data Guidelines for LDS

Using fundamental Lightning components based on Lightning Data Service is the simplest approach to interact with Salesforce data. Use a Lightning Data Service wire adapter directly if you require greater flexibility. Different data and metadata are offered by each cable adapter. The data and metadata are provisioned to your component via the wire service. Last but not least, utilise Apex if LDS wire adapters aren’t flexible enough.

All of the standard and custom objects that User Interface API supports are supported by Lightning Data Service. Custom metadata types, person accounts, and external objects are not supported. Lightning Data Service is not subject to any API usage charges, although it is restricted in some ways, such as the maximum number of records that can be retrieved.

Changes to a record are reflected in all the technologies built on it by the Lightning Data Service, which handles data for you.

Lightning Data Service and components and adapter
Image Source: Developers.Salesforce

lightning-record-form

The simplest approach to show a form to add, update, or view a record is with this component. When a field is being edited, the form automatically transitions between view and edit modes. With support for multiple columns, the component uses the object’s default record layout. It loads either the entire compact or complete layout of the object, or just the fields you request.

When possible, specify fields rather than a layout to boost efficiency. Only specify a layout if you want the administrator, not the component, to manage the supplied fields. Every field assigned to the layout that is received by the component must be handled for the context user.

 

lightning-record-edit-form and lightning-record-view-form

Use lightning-record-edit-form (to add or change a record) and lightning-record-view-form (to enable custom rendering of record data) to modify the form presentation (to view a record). Using the lightning-input-field component, you can pre-populate field values on the lightning-record-edit-form.

Conclusion

In this way, the simplest way to interface with Salesforce data is by using basic Lightning components built on Lightning Data Service.

 

Additional Resources

Leave a reply

Your email address will not be published. Required fields are marked *