Im assuming your controller property to get the options looks something like one of the following
If you are taking the values directly from a specific picklist field
public List<SelectOption> getMyOptions() {
List<SelectOption> options = new List<SelectOption>();
Schema.DescribeFieldResult field = yuopurObject.YourField.getDescribe();
for (Schema.PicklistEntry f : field.getPicklistValues()){
options.add(new SelectOption(f.getLabel(), f.getLabel()));
}
return options;
}
Or if you are manually adding the options, then something like this
public List<SelectOption> getMyOptions() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('Option1','Option1'));
options.add(new SelectOption('Option2','Option2'));
options.add(new SelectOption('Option3','Option3'));
return options;
}
If you want to adjust the options according to profile then you could simply do something like this
public List<SelectOption> getMyOptions() {
List<SelectOption> options = new List<SelectOption>();
//Might want to look into storing in a custom setting to avoid SOQL call
Profile p = [Select Id, Name From Profile Where Name = 'Your Profile Name'];
if(System.Userinfo.getProfileId() = p.Id){
//add your values here
}else{
//add alternate values here
}
return options;
}
If you define your picklist options using apex:selectOption
, you can use the title
parameter of each to specify hovertext. example:
<apex:selectList id="typeSelect" size="1" value="{!typeSelect}" >
<apex:selectOption title="helptext for hover" itemLabel="{!$ObjectType.Key_Contact__c.LabelPlural}" itemValue="Key_Contact__c" />
<apex:selectOption title="helptext for hover" itemLabel="{!$ObjectType.Roster__c.LabelPlural}" itemValue="Roster__c" />
<apex:selectOption title="helptext for hover" itemLabel="{!$ObjectType.Team__c.LabelPlural}" itemValue="Team__c" />
<apex:selectOption title="helptext for hover" itemLabel="{!$ObjectType.User.LabelPlural}" itemValue="User" />
</apex:selectList>
Best Answer
Essentially, you create and save the new record type along with a new page for it. Once you do, you can assign the pages and Record Types to different profiles. You'll then have a Page Layouts related list and a Record Types related list.
In one or the other, click Page Layout Assignment > Edit Assignment. From there you can assign the different picklist fields you want to be visible to one or both of the RecordType pages.
There's a good description of this in the Force.com Workbook here.