• carlv
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

Hi All,

 

Having created a post via apex, am trying to add a comment to that post - unsuccessfully.

 

Code is pulled straight from the cookbook examples -

 

FeedPost fpost = new FeedPost();
            fpost.ParentId = post.Post_Parent_record_Id__c; // target record to attach post to

            fpost.Body = post.Name;
            insert fpost;

 

The step above works fine. However if I try to use fpost.id as a link for the comment, I get an error stating fpost.id is not correct id type. See below -

 

FeedComment fcomment = new FeedComment();
                fcomment.FeedItemId = fpost.id; // should link to Post record from step 1 right?
                fcomment.CommentBody = comment.Name;
                insert fcomment;      

 

What am I doing wrong with the comment? I must be misunderstanding how comments relate to posts. Any assistance most appreciated.

 

 

  • March 25, 2010
  • Like
  • 0

Hi All,

 

Having created a post via apex, am trying to add a comment to that post - unsuccessfully.

 

Code is pulled straight from the cookbook examples -

 

FeedPost fpost = new FeedPost();
            fpost.ParentId = post.Post_Parent_record_Id__c; // target record to attach post to

            fpost.Body = post.Name;
            insert fpost;

 

The step above works fine. However if I try to use fpost.id as a link for the comment, I get an error stating fpost.id is not correct id type. See below -

 

FeedComment fcomment = new FeedComment();
                fcomment.FeedItemId = fpost.id; // should link to Post record from step 1 right?
                fcomment.CommentBody = comment.Name;
                insert fcomment;      

 

What am I doing wrong with the comment? I must be misunderstanding how comments relate to posts. Any assistance most appreciated.

 

 

  • March 25, 2010
  • Like
  • 0

Hi everyone,

 

Does anyone have any experience/example code with setting a sites page to function as a listener/handler for an http POST?  

 

Thanks!