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
SubbuSubbu 

I have a custom picklist on Account objects it contains values A,B and C. I am accessing this picklist at visualforce by using the <apex:inputfield> .So I don't want to get all the picklist values  , I want values (B and C) at visualforce

I have a custom picklist on Account objects it contains values A,B and C. I am accessing this picklist at visualforce by using the <apex:inputfield> .So I don't want to get all the picklist values  , I want values (B and C) at visualforce, Could you please suggest me.
Mehul MakwanaMehul Makwana
IF you assigning value to the profile level then you can create record types to assign different picklist to different user.
Or else you can create custom pickist in vf page by refering below example.
 
// Visual Force Page

<apex:pageBlockSection >
            	<apex:selectList value="{!country}" label="Country" multiselect="false" size="1">
                    <apex:actionSupport event="onchange"/>
                        <apex:selectOptions value="{!countryOptions}"/>
                </apex:selectList>
</apex:pageBlockSection>

// Controller Code
 public List<SelectOption> getcountryOptions() 
     {
        List<Country__c> countryNames = new List<Country__c>([SELECT Name FROM Account]);
            List<SelectOption> countryOptions = new List<SelectOption>();        
                countryOptions.add(new SelectOption('','-- Select One --'));
		countryOptions.add(new SelectOption('B','B'));
		countryOptions.add(new SelectOption('C','C'));
        	
            return countryOptions;
     }

SubbuSubbu
Hi Mehul,
 I am new to Salesforce Pleae give the steps to how assigning value to the profile level then  create record types to assign different picklist to different user.

Thanks In Advance
Subbu