+ Start a Discussion
ifthikar ahmedifthikar ahmed 

could some one explain the below code

01<apex:page standardController="Contact" Sidebar="False">
02<apex:form >
03    <apex:pageBlock >
04        <apex:pageBlockSection >
05           Contact First Name : {!Contact.FirstName}<br/>
06           Contact Last Name : {!Contact.LastName} <br/>
08           Contact Owner Email : {!Contact.Owner.Email}
10        </apex:pageBlockSection>
11    </apex:pageBlock>   

my concern is reg line number 5 and 6 there is no field in contact with name firstname and second name respectively.. then how to trace those 2 line for better understanding
Alain CabonAlain Cabon
@ifthikar ahmed

The rules for the fields of a contact name are clearly difficult to see in Lighning.

If you switch in Classic, you will see clearly "Salutation" (can be modified for the picklist), and the fields  "FirstName" / "LastName" (cannot be modified) below the field "Name".

LastName is always required and that cannot be modified.
Contact cnt = [select firstname,lastname from contact where id = '003....'];
system.debug('cnt firstname:' + cnt.firstname);
system.debug('cnt lastname:' + cnt.lastname);
cnt.firstname = 'first1';
cnt.lastname = 'last1';
update cnt;

Even if the fields FirstName and LastName are not visible in the Setup of Lightning, you can read and modify them directly.
ifthikar ahmedifthikar ahmed
@ Alain Cabon understood thank you for the replyy