function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
You can use the new Chatter API in Apex to do this. It's in developer preview currently and is on by default in all Developer Edition orgs.
Here's an example of how to use it:
String communityId = null;
String feedItemId = 'YOUR_FEEDITEM_ID';
ConnectApi.FeedItem feedItem = ConnectApi.ChatterFeeds.getFeedItem(communityId, feedItemId);
List<ConnectApi.MessageSegment> messageSegments = feedItem.body.messageSegments;
for (ConnectApi.MessageSegment messageSegment : messageSegments) {
if (messageSegment instanceof ConnectApi.MentionSegment) {
ConnectApi.MentionSegment mentionSegment = (ConnectApi.MentionSegment) messageSegment;
System.debug('Mentioned user name: ' + mentionSegment.name);
System.debug('Mentioned user id: ' + mentionSegment.user.id);
}
}
Regards,
Ashish