Lightning Web Components
First we have to known in how many ways we can interact with Salesforce Data
Salesforce provides several ways for Lightning web components to work with data. Always start with the simplest solution and move to a solution that allows for more customization as needed.
Different Approach to work with Salesforce Data:-
1.Base Lightning Components built on the Lightning Data Service
- Use this approach if you want to play with lightning forms
- To create forms that let user view, edit, and create salesforce records use the
lightning-record-form,
lightning-record-edit-form,
and lightning-record-view-form components
2.Lightning Data Service Wire Adapters and Functions with wire service :-
Always use base lightning components if you want display forms and if you want perform some customization and logic then you go for with this approach.
- Use this to get raw record data like picklist, recordinfo, objectinfo,
- Want more customization to create forms,
- you want to perform business logic.
3.Use Apex :-
- Apex method can be called wire and imperatively,
- If LDS base components and wire adapters not flexible enough for the task then you can use apex .
Comments
Post a Comment