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
nbknbk 

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]}"/> 
     </apex:repeat>
<apex:pageBlockSection>
</apex:pageBlock>
</apex:form>

 

 

sandeep@Salesforcesandeep@Salesforce

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

nbknbk

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.!

 

Thanks,

Krishna

 

 

 

sandeep@Salesforcesandeep@Salesforce

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

Theblogreaders.com

 

you can check some more details in above BLOG

 

Thanks & Regards

TBR

sandeep@Salesforcesandeep@Salesforce

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