+ Start a Discussion
dsh210@lehigh.edudsh210@lehigh.edu 

Adding '@' tag to a chatter post from Apex

Hi All,

 

I am trying to figure out how to direct a chatter post at a user when it is created in Apex. Looking at existing posts, the Body just contains '@ Sample User'. However, simply adding that text to the body of a new Chatter post in Apex yields just plain text. When creating in the UI, the syntax @[Sample User] is used, but in Apex this generates the same plain text result.

 

Has anyone figured out how to successfully direct an Apex created FeedItem (Chatter Post) at another user?

 

Thanks,

DH