+ Start a Discussion
admin 7admin 7 

contact's First Name(with Salutation) in the VF page

HI , 

I wrote VF page on contact's First Name(with Salutation)  on new contact page, i want disply the same as detail page can you write the code for detail page....




Code

<apex:pageBlockSectionItem >
    <apex:outputlabel value="First Name"/>
    <apex:outputpanel >
        <apex:outputfield value="{!Contact.Salutation}" />
        &nbsp;
        <apex:outputfield value="{!Contact.FirstName}" />
    </apex:outputpanel>
</apex:pageBlockSectionItem>




 
JyothsnaJyothsna (Salesforce Developers) 
Hi Naveen,

Please check the below sample code.

Visualforce page
<apex:page standardController="Contact" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >

   <apex:pageBlockSectionItem >
         <apex:outputlabel value="First Name"/>
         <apex:outputpanel >
         <apex:inputfield value="{!Contact.Salutation}" />
         &nbsp;
         <apex:inputfield value="{!Contact.FirstName}"/>
         </apex:outputpanel>
  </apex:pageBlockSectionItem>
  <apex:inputfield value="{!Contact.lastname}"/>
  <apex:inputfield value="{!Contact.name}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>   
</apex:page>

User-added image


Please check the Contact field list.

https://help.salesforce.com/apex/HTViewHelpDoc?id=contacts_fields.htm&language=en_US

Hope this helps you!
Best Regards,
Jyothsna
admin 7admin 7
HI Jyothsna , 

this code is related to New page, i want to detail page code