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
Carson HuangCarson Huang 

Adding a picklist to Visual Force

Hi guys,

I'm trying to add a picklist to the VF page. However, when using Input Field, I only get the picklist field of 1 option. How do I get all theoptions?

<apex:pageBlock title="Access Details">
            <apex:pageBlockSection columns="2" >
                     <apex:inputField label="Family" value="{!rec.Family__c}" />
            </apex:pageBlockSection>
</apex:pageBlock>

AshlekhAshlekh
Hi,

If rec.Family__c is picklist type then if will populate all options which you have defined in picklist field or it may be depended on record type.
Carson HuangCarson Huang
Hi Ashlekh,

Yes, this picklist is dependent on a record type. I have four record types, and this one is only for one of them.
Carson HuangCarson Huang
Hi Ashlekh again,

I would like to add that the only option that shows is '--None--', the dafault value. The VF still shows a picklist field, but the picklist field only contains one option.