Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fractastical/989761 to your computer and use it in GitHub Desktop.
Save fractastical/989761 to your computer and use it in GitHub Desktop.
@CloudCoder Add Chatter Comment
List<UserFeed> myfeed = [SELECT Id, FeedPostId
FROM UserFeed
WHERE feedpostid = :recipeSixFPostID LIMIT 1];
FeedComment fcomment = new FeedComment();
fcomment.FeedItemId = myfeed.get(0).id;
fcomment.CommentBody = recipeSixComment;
insert fcomment;
recipeSixComment = '';
ApexPages.addMessage(
new ApexPages.Message(ApexPages.Severity.INFO, 'Comment Added'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment