dynamic picklist in lightning web component -- w3web.net

Fetching picklist values dynamically through apex class method and display selected picklist value in Salesforce lightning web component – LWC

Hey guys, today in this post we are going to learn about how to Fetch picklist values dynamically through apex class method and display selected picklist value in Salesforce lightning web component – LWC.

Files we used in this post example

lwcPicklistController.cls Apex Class Controller It is used for fetch the picklist value dynamically from server.
fetchPicklistValueLwc.html Lightning Web Component HTML Template HTML file for used to write HTML element for user interface.
fetchPicklistValueLwc.js LWC JavaScript File It is holding @Wire method function that is fetching the picklist value from database.
fetchPicklistValueLwc.js-meta.xml Visualforce Component It is used for where this lightning web component you want to exposed.

Live Demo

Fetch picklist values Dynamic in lwc -- w3web.net

Other related post that would you like to learn in LWC

Create Apex Class Controller

Step 1:- Create Apex Controller : lwcPicklistController.cls

SFDX:Create Apex Class >> New >> lwcPicklistController.cls

lwcPicklistController.cls [Apex Class]

Create Lightning Web Component

Step 2:- Create Lightning Web Component : fetchPicklistValueLwc.html

SFDX:Lightning Web Component >> New >> fetchPicklistValueLwc.html

fetchPicklistValueLwc.html [Lightning Web Component HTML]

Create LWC JavaScript File

Step 3:- Create Lightning Web Component : fetchPicklistValueLwc.js

SFDX:Lightning Web Component >> New >> fetchPicklistValueLwc.js

fetchPicklistValueLwc.js [LWC JavaScript File]

Create LWC Meta Data XML

Step 4:- Create Lightning Web Component : fetchPicklistValueLwc.js-meta.xml

SFDX:Lightning Web Component >> New >> fetchPicklistValueLwc.js-meta.xml

fetchPicklistValueLwc.js-meta.xml [LWC Meta Data XML]

Fetch picklist values Dynamic in lwc -- w3web.net

Further post that would you like to learn in LWC

Leave a Comment

Please Contribute to Support If Some Value Added in Your Project or Website