How to display Standard controller Picklist using Apex

How to display Standard controller Picklist using Apex

The below code is used to display Rating picklist of standard object Account.

<apex:page standardController=”Account”>

    <apex:form >
   
    <apex:pageMessages />
   
    <apex:pageBlock >
        <apex:pageBlockSection columns=”2″>
            <apex:pageblockSectionItem >
                <apex:outputLabel value=”Rating”/>
            </apex:pageblockSectionItem>       
            <apex:pageblockSectionItem >
                <apex:inputField value=”{!Account.Rating}”/>             
            </apex:pageblockSectionItem>           
        </apex:pageBlockSection>       
    </apex:pageBlock>

    </apex:form>

</apex:page>

Output:

Leave a Reply