• Ankur Kumar
  • NEWBIE
  • 0 Points
  • Member since 2013

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

Hello folks.  This is probably very simple...

 

I am creating an apex page, and want to imbed chatter updates into the page.  The Apex code for the feed is as follows:

 

List<NewsFeed> myfeed = [SELECT Id, Type,                          

CreatedById, CreatedBy.FirstName, CreatedBy.LastName,                         

ParentId, Parent.Name,                          

Body, Title, LinkUrl, ContentData, ContentFileName,                             

(SELECT Id, FieldName, OldValue, NewValue                              

FROM FeedTrackedChanges ORDER BY Id DESC),                              

(SELECT Id, CommentBody, CreatedDate,                             

CreatedBy.FirstName, CreatedBy.LastName                             

FROM FeedComments ORDER BY CreatedDate LIMIT 10),                             

(SELECT CreatedBy.FirstName, CreatedBy.LastName                             

FROM FeedLikes)                         

FROM NewsFeed                         

ORDER BY CreatedDate DESC, Id DESC                         

LIMIT 20];

 

Of course, I can't place this code directly into a Visualforce <apex> tag (or can I?).  So the question is, where do I save this code, and how do I reference it in my VF page?

 

Thanks!