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

 

 

SrikanthKuruvaSrikanthKuruva

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?

ChizChiz

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" >

  <apex:selectOptionsvalue="{!viewListPicklist}"/>

 </apex:selectList>

</apex:pageBlockSection>

...

 

 

I hope my example will help you.