function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sai M 54Sai M 54 

Getting contact name as Null in trigger context variable

Hi,

I am trying to send an email, whenever there is an update on contact field. I am able to access the con.email but not con.name. In the body, I am trying to use the contact name(tried firstname, lastname - both has values in it), which is returning null. Any suggestions will appriciated.User-added imageUser-added image
Sai M 54Sai M 54
It looks like compound field can only be queried but to access we need to use original field name.
Prateek Prasoon 25Prateek Prasoon 25
Try using this -
emailBody = 'Hello '+ con.FirstName + ' ! Added/Updated record' ; 
 
And if you want to send the last name as well, concatenate con.LastName .

If you find this answer helpful, Please mark it as the best answer.