+ Start a Discussion

Dynamic picklist values in Fieldset

Hello Everyone,


I have a requirement to render dynamic picklist values in Fieldset based on "NumberofEmployees" value from Account object. Please find the details as below.


Picklist  - Account Status --> Picklistval1, Picklistval2,Picklistval3

Fieldsetname - DemoFieldset -> the fieldset contains "Account Status, Account Name..etc" (there are around 15 fields available in fieldset and some of the fields have dependent fields one each other)


Now I want to show Picklistval1, Picklistval2 values when the "NumberofEmployees"<10, other wise show 3 items(Picklistval1, Picklistval2,Picklistval3)

How can I acheive this.? Please share your ideas to implement this!!


<apex:page standardController="Account" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection title="test">
    <apex:repeat value="{!$ObjectType.Account.FieldSets.DemoFieldset}" var="GS" >  
                              <apex:inputField value="{!account[GS]}"/> 




I dont think it is possible of showing pick listoptions dynamically. it is only possible based on record type enabled for
your page layout in case of Native Screen.

You can do this by creating only custom select list using
<apex:selectList> tag


Thanks Sandeep for reply.

Is it possible in Fieldset, because am using in Repeat tag value="{!account[fs]}" and required to put multiple conditions to render the picklist field.


one  question -> Is custom VFP allows dependent picklist functioanltiy as Native page suports.!








No It is not possible for dependent native picklist on VF page.


In for your original query as i told earlier that you need to use custom select list no other work aound seems to be possible here.Please let me know if any other query you have and

Gomathi SGomathi S



you can check some more details in above BLOG


Thanks & Regards



Field Set binds all values of pick list so can not provife dynamic logic over it.