+ Start a Discussion
Sam AlexSam Alex 

get Contact First Name from Contact Object


I want to get the First Name of the Contact Object. When I go to the Contact Objects Fields, they only have a field called NAME. NAME is a combination of (PreFix, First Name and Last Name). 

Is there a way to access the First Name of that conatct from apex code?

Please Help me.

Thanks in advance.
Sujan Kumar ReddySujan Kumar Reddy

Hi Sam,

Contact FirstName directly we can access in our SOQL.

Try this query in Developer Console.

SELECT FirstName FROM Contact

User-added image



Sam AlexSam Alex

Hi Sujan, 

Thanks for your quick response. I will give it a try.

Cant we access it like, ContactObject.FirstName?


Sam AlexSam Alex
Hi Sujan,

the value is now comming. And also we can access the same value from the object it self. 
Thank you.
Sujan Kumar ReddySujan Kumar Reddy