How to fetch picklist values from apex controller in lightning component

Vijay Kumar
2 min readJul 29, 2020
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:-

statusApp.app

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.

Final Output

Other post that would you like to learn

Step 1:- Create Lightning Application : statusApp.app

From Developer Console >> File >> New >> Lightning Application

statusApp.app [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]

Further post that would you like to learn

Originally published at https://www.w3web.net on July 29, 2020.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response