+ Start a Discussion
Nagaraju Mogili 31Nagaraju Mogili 31 

how can we display the contact fields on vf page using apex controller

Best Answer chosen by Nagaraju Mogili 31
v varaprasadv varaprasad
Hi Nagaraju,

Please check code once :
 
===Controller=========
public class DisplayFields {
    public Contact con{get;set;}
    
    public DisplayFields(){
        
        
    }

}

===========Vf page =======

<apex:page controller="DisplayFields">
    <apex:form>
        <apex:pageBlock title="Contact fields">
            <apex:pageBlockSection>
                    <apex:inputField value="{!con.Lastname}"/>
                    <apex:inputField value="{!con.Phone}"/>
                    <apex:inputField value="{!con.Email}"/>
                </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

==================================

Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.

Thanks
Varaprasad
@For Support: varaprasad4sfdc@gmail.com