I created VF page with a Multi - picklist field using <apex:inputField value="{!obj.Hobbies__c}" />
But the values in VF page Multi - picklist showing the different values compare with values in the object field. I got a record types in this object as well.
<apex:page controller="controllerClass">
<apex:form >
<apex:image value="{!$Resource.Logo_Medium}" style="height:150px;width:150px;" rendered="{!Logo}"/>
<apex:image value="{!$Resource.Logo_Transparent}" style="height:67px;width:337px;" rendered="{!InLogo}"/>
<apex:pageBlock mode="edit" title="Lead Edit">
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!dosave}"/>
<apex:commandButton value="Cancel" action="{!doCancel}" immediate="true"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Information" columns="2">
<apex:pageblocksectionitem >
<apex:outputlabel value="{!$ObjectType.Lead.Fields.FirstName.label}">
</apex:outputlabel>
<apex:outputpanel >
<apex:inputfield value="{!lead.Salutation}" ></apex:inputfield>
<apex:inputfield value="{!lead.FirstName}" ></apex:inputfield>
</apex:outputpanel>
</apex:pageblocksectionitem>
<apex:inputField value="{!lead.LastName}"/>
<apex:selectList label="Campaign" size="1" value="{!CampaignName}" >
<apex:selectOptions value="{!ActiveCampaign}" ></apex:selectOptions>
</apex:selectList>
<apex:inputField value="{!lead.Street}"/>
<apex:inputField value="{!lead.LeadSource}" />
<apex:inputField value="{!lead.City}"/>
<apex:inputfield value="{!lead.PostalCode}"></apex:inputfield>
<apex:inputField value="{!lead.Phone}"/>
<apex:inputField value="{!lead.MobilePhone}"/>
<apex:inputField value="{!lead.Email}"/>
<apex:inputField value="{!lead.hobbies__c}"/> // multiPicklist
</apex:pageBlockSection>
<apex/page:block>
</apex:form>
Attribution to: rakesh
Possible Suggestion/Solution #1
The first idea i've got is that you are reading the picklist values, not labels toLabel(Hobbies__c)
.
Attribution to: Sergej Utko
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/5325