+ Start a Discussion
Bhola VishwakarmaBhola Vishwakarma 

how to get a paticular piclist values for a given record types

i have created three recordtypes A ,B ,C 

and i have a picklist of 50 elements how do i display a paticular piclist values on my visualforce page according to my recordtypes




Once you set the picklist values for each recordtype you dont have to do anything extra if you are using standard controller. Are you using standard controller or custom controller?


Controller code:


public List<SelectOption> viewListPicklist {

 get {

  Schema.DescribeFieldResult fieldResult = [class_name].[picklist_field].getDescribe();

  List<string> qwerty = fieldResult.getPicklistValues();

  for (string item : qwerty) {

   viewListPicklist.add(newSelectOption(item, item));


  return viewListPicklist;





Page code:


<apex:pageBlockSectioncolumns="1"title="some title"collapsible="false">

 <apex:selectList multiselect="true"size="5"value="{!selectedListxxx}"id="xxxPicklist" >







I hope my example will help you.