+ Start a Discussion
ifthikar ahmedifthikar ahmed 

Visualforce page which shows a basic Contact record

with ref to the trails head 
Create a Visualforce page which shows a basic Contact record
Using the Contact standard controller, create a Visualforce page which displays a Contact's First Name, Last Name and the Email address of the Contact's Owner. 
Challenge Requirements
The page must be named ContactView
It must reference the Contact standard controller
It should include three bound variables that use the standard controller to display the following Contact record information:
First Name
Last Name
Owner Email

when i checked the contact's field i could see first name and last name is not at all available instead just name filed is there.

then how could the below code works ??

<apex:page standardController="Contact">
    
    <apex:pageBlock title="Contact Summary">
        <apex:pageBlockSection>
            
            {! Contact.firstName} <Br/>
             {! Contact.lasttName} <Br/>
           
            
            
        </apex:pageBlockSection>
    </apex:pageBlock>
Best Answer chosen by ifthikar ahmed
Vikash GoyalVikash Goyal
Hi Ifthikar,

Contact's 'Name' field is just concatenation of FirstName, MiddleName, LastName, and Suffix.

You can reference the following docs for contact fields :
  1. https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contact.htm
  2. https://help.salesforce.com/articleView?id=contacts_fields.htm&type=5 (https://help.salesforce.com/articleView?id=contacts_fields.htm&type=5)
  3. https://developer.salesforce.com/docs/atlas.en-us.sfFieldRef.meta/sfFieldRef/salesforce_field_reference_Contact.htm
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks

All Answers

Vikash GoyalVikash Goyal
Hi Ifthikar,

Contact's 'Name' field is just concatenation of FirstName, MiddleName, LastName, and Suffix.

You can reference the following docs for contact fields :
  1. https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contact.htm
  2. https://help.salesforce.com/articleView?id=contacts_fields.htm&type=5 (https://help.salesforce.com/articleView?id=contacts_fields.htm&type=5)
  3. https://developer.salesforce.com/docs/atlas.en-us.sfFieldRef.meta/sfFieldRef/salesforce_field_reference_Contact.htm
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks
This was selected as the best answer
ifthikar ahmedifthikar ahmed
HI Vikash,
 is there a way we could find these details from the salesforce UI itself ???
Deepali KulshresthaDeepali Kulshrestha
Hi ifthikar,

- I read your problem and implemented it in my Org and it is working fine.
- Please use the below code [Solved] : -
 
<apex:page standardController="Contact">
    <apex:pageBlock title="Contact Summary">
        <apex:pageBlockSection >
            First Name: {! Contact.FirstName } <br/>
            Last Name: {! Contact.LastName } <br/>
            Owner's Email: {! Contact.Owner.Email } <br/>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha.