You need to sign in to do that
Don't have an account?

No picklist values on my visualforce page
Hello,
I'm not a coder by any stretch, but I've been dabbling a bit to see if I can learn. We currently have a customer Lead convert page in our org where I'd like to add a field for "Qualifying Reason" (a custom picklist that has been created on the Lead). I mimicked some existing code to get the field on the visual force page and I tried to update the controller, by mimicking existing code as well.
What I get is a field for "Qualifying Reason" and picklist box with no values. From researching around, it looks like I need additional coding in my controller to pull the values, but my various attempts to do so have only created errors for me...
Can anyone provide any gudiance here?
Thank you!!!
TK
Visual Force Page:
<apex:pageblocksectionitem >
<apex:outputlabel >Converted Status</apex:outputlabel>
<apex:outputPanel layout="block" styleClass="requiredInput">
<apex:outputPanel layout="block" styleClass="requiredBlock"/>
<apex:selectlist value="{!ConvertedStatus}" required="true" multiselect="false" size="1" onchange="processChange()">
<apex:selectOptions value="{!ConvertedStatuses}"/>
</apex:selectlist>
</apex:outputpanel>
</apex:pageblocksectionitem>
Controller:
public String QualifyingReason {get; set;}
public List<SelectOption> QualifyingReasons {get; set;}
What my page looks like:
If your VF page does not use the standard controller for Lead then you'll probably want to do a "describe (https://developer.salesforce.com/blogs/developer-relations/2008/12/using-the-metadata-api-to-retrieve-picklist-values.html)" on the picklist field.
All Answers
Source:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_selectList.htm
Regards,
Mahesh
If your VF page does not use the standard controller for Lead then you'll probably want to do a "describe (https://developer.salesforce.com/blogs/developer-relations/2008/12/using-the-metadata-api-to-retrieve-picklist-values.html)" on the picklist field.