getting picklist values dynamically by

How to fetch picklist values from apex controller in lightning component

Hey guys, In this post we are going to learn about how to retrieve Picklist values from Apex controller in Lightning Component.

Files we used in this post example:- Lightning Application It is used for call the component to preview on browser.
statusCmp.cmp Lightning Component It is used for create a picklist select option field.
statusCmpController.js JavaScript Controller File It is used for communicate to server side apex method and fetch the picklist value from init fuction.
statusCmpHelper.js JavaScript Helper File Helper function call in to javascript init function.
pickListController.apxc Apex Class Controller It is used for retrieve picklist values from database.

Custom Object:- Course__c

Custom Object Picklist Fields:-


Picklist Value:-




Custom Object and their fields

We retrieve picklist values from custom field and display on the dropdown.


Other related post that would you like to learn…

Step 1:- Create Lightning Application :

From Developer Console >> File >> New >> Lightning Application [Component Application File]

Step 2:- Create Lightning Component : statusCmp.cmp

From Developer Console >> File >> New >> Lightning Component

statusCmp.cmp [Lightning Component]

Step 3:- Create Lightning Component : statusCmpController.js

From Developer Console >> File >> New >> Lightning Component >> JavaScript Controller

statusCmpController.js [JavaScript Controller]

Step 4:- Create Lightning Component : statusCmpHelper.js

From Developer Console >> File >> New >> Lightning Component >> JavaScript Helper

statusCmpHelper.js [JavaScript Helper]

Step 5:- Create Lightning Application : pickListController.apxc

From Developer Console >> File >> New >> Apex Class

pickListController.apxc [Apex Class Controller]

Related further post that you want to learn……

Step 6:- Final Output

fetching picklist values dynamically in lightning by

Leave a Comment