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
KymLeKymLe 

Trigger on FeedItem to access @ mentions?

I am writing a trigger (after insert) on FeedItem.  If there's an @ mentions in the body, I need to get the User Id.  Can someone tell me how to do this?

 

Thanks in advance!

Sonam_SFDCSonam_SFDC

When a feed has @mention, the message Segment input is set to mention and this has the userID of the user @mentioned - i believe you can use this to the users mentioned in a post/comment

 

Message Segment Input: Mention

Represents an inline mention of a user. You must provide a user ID. No spaces are added.

Name                            Type                                           Description                                             Available Version
id                                   String                                     ID of the user to be mentioned.                         23.0
type                               String                                            Value is Mention.                                           23.0