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
Esther MercEsther Merc 

Visualforce Picklist Values from Custom Object not showing

Hi Guys,

I have this page  which is showing no error in code but the Security Question picklist values is not showing the options from the custom Registration__c  object field named Security Questions which is a picklist.
Can you please help me.          Below is VF and Controller Class

<apex:page Controller="NewRegistration"  sidebar="false"   showHeader="false">
<apex:sectionHeader title="Registration Page"/>
<apex:form >
<apex:pageBlock id="pg1" >
  <apex:pageMessages />
    <apex:pageBlockSection columns="1">
        <apex:inputText label="Name" value="{!}"/>
        <apex:inputText label="Username" value="{!reg.Username__c}"/>
        <apex:inputSecret label="Password" value="{!reg.Password__c}"/>
        <apex:inputSecret label="Confirm Password" value="{!reg.Confirm_Password__c}"/>
        <apex:selectlist label="Security Question" value="{!reg.Security_Question__c}"/>
        <apex:inputText label="Security Answer" value="{!reg.Security_Answer__c}"/>       
    <apex:pageBlockButtons >       
          <apex:commandButton value="Submit" action="!saveAction" reRender="pg1" />

Controller Class
public class NewRegistration {

  Public Registration__c  reg {get ; set;}
  public NewRegistration(){
         reg = new Registration__c ();
    public void saveAction(){
      system.debug ('saveAction inside' +reg);  
        insert reg;
        if ( !=null) {        
        Apexpages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.INFO,'Registration Saved Successfully'));

Best Answer chosen by Esther Merc
Sai PraveenSai Praveen (Salesforce Developers) 

Can you check the below article which shows the same behaviour.

If this solution helps, Please mark it as best best answer.