@cloudcoder Add Chatter Comment


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. List<UserFeed> myfeed = [SELECT Id, FeedPostId
  2. FROM UserFeed
  3. WHERE feedpostid = :recipeSixFPostID LIMIT 1];
  4.  
  5. FeedComment fcomment = new FeedComment();
  6. fcomment.FeedItemId = myfeed.get(0).id;
  7. fcomment.CommentBody = recipeSixComment;
  8. insert fcomment;
  9.  
  10. recipeSixComment = '';
  11. ApexPages.addMessage(
  12. new ApexPages.Message(ApexPages.Severity.INFO, 'Comment Added'));
  13.  

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.