Dynamically Show Fields in lightning-record-edit-form in Salesforce Lightning Web Components
- Saurabh Singh
- May 17, 2024
- 1 min read
Updated: May 13
In Salesforce, lightning-record-edit-form is a powerful component that allows you to create and edit records with ease. However, there are scenarios where you might want to display a dynamic set of fields. This can be based on user input, specific conditions, or other logic within your component.
Instead of giving fields name in LWC component itself, you can store these field api in Metadata and fetch from apex class.
Great insight, Saurabh! Using metadata and Apex to dynamically control fields in lightning-record-edit-form is a smart approach. We’ve seen this method add real value in optimizing Salesforce UI for clients. Thanks for sharing!