function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Piyush Sharma 6Piyush Sharma 6 

I have a requirement to prompt user with a list of values once an action is selected on Lead detail page in lightning. Can anyone tell me how can I achieve this. Can I display Picklist values on the window which pops up once the action is selected?

Jefferson FernandezJefferson Fernandez
Hi Piyush,
If you referring to a Custom Action on Lead detail page, yes you can create a custom component containing the list of values. You may check the options you have on custom action but it seems there's no way standard way to display the picklist that you're referring without really creating and coding a custom lightning component containing the list. You will have to use the interface force:lightningQuickAction on your custom component for it to be available on the Lead page. But i'm not sure if it works on the lead detail page so if it doesn't work, you may have to create a Visualforce container, housing the custom lightning component you will create. These are all custom so you will have to learn and build them which both are different topics.
Thanks,
Piyush Sharma 6Piyush Sharma 6
Hi Jeff

Thanks for the reply.
I am looking for a custom solution which invloves creating a lightning action component.

When user clicks that action, he will be prompted with list of values. User will choose one and click Ok. Then an apex class will be called which will have that value selected by user and I will perform certain DML operations there.
Can you explain the steps of doing it.

I have created some basic custom action components, but not aware of how to implement this one.

Thanks,
Jefferson FernandezJefferson Fernandez
High level steps are:
  1. Learn to build lightning components and create a component to display the list of values. Study for Trailheads' Lightning Components Basics (https://www.google.com.ph/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwiF9Ny_5obWAhUBgbwKHQBnB-IQFggpMAA&url=https%3A%2F%2Ftrailhead.salesforce.com%2Fen%2Fmodules%2Flex_dev_lc_basics&usg=AFQjCNHuLILGagd9pmn-f4lAv52Mt1Veqw)
  2. Create a Visualforce page to house the lightning component you built. https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_visualforce.htm
  3.  Create a custom action on Lead page and launch the VF page you created which contains the lightning component which contains the list of values.
  4.  Embed the custom action on Lead page layout.
What you're asking is a broad subject so it can't be detailed on specific steps. What is important is do your best to learn and build something first then go back to the requirement. One step at a time.
Thanks,
Piyush Sharma 6Piyush Sharma 6
Hi Jeff

Thanks for the response. I figured out another way to implement this without using custom VF pages.

I have created a Modal component and it is called from a quick action which I have configured on the detail page. It
looks like below. Ok button calls the controller from which I can call any apex class/method.
Modal component with List of values and Ok and Cancel button