0

I'm wondering if the chatter:feed component in VF can show a single feed item in that feed rather than the whole feed. That is, a single post that has the All Updates > This Update marker at the top.

The component does use the entityId attribute so it makes sense that it shows the record's entire feed. But it looks like the url for a feedItem takes in two parameters: salesforce.com/a0V6F00000ZOer8?fId=0D55D000003SNb0, one for the record and one for the feedItem.

For context, the use for this on my page is that I have a list of records, each row having a button. The button uses jquery to open a popup window with an iframe of that record's chatter feed (which is just another VF page with chatter:feed). I'm displaying the whole feed, but I only need a single post that has a particular topic.

Any suggestions on other ways I can display the filtered feedItem are very welcome :)

Thanks!

2

Since you're looking for only a single FeedItem record, just do a SOQL query for the FeedItem record and render the data on the screen. A FeedItem is a record just like any other; the VF component you're talking about just makes it easier to render complex UI pieces. You're rendering just one FeedItem, so it's probably easier to do the simple query.

Having said that, if you want to do some more finely-grained work, check the Apex ConnectAPI namespace, especially the FeedElement section: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_ConnectAPI_ChatterFeeds_static_methods.htm#apex_ConnectAPI_ChatterFeeds_getFeedElement_1

  • Thanks! Yes, the FeedItem is what I require, and I have been using ConnectAPI. – PrawnCrackers Jan 9 '18 at 23:58
  • The only question is whether a feedItem can be used in a chatter:feed component. Right now, I'm feeding the object record Id into the entityId attribute to show the whole feed, but only want to show feedItems that are tagged with a particular topic. I can grab those in SOQL, but I cannot figure out how to only display those tagged feeditems. My workaround is to post them as a link feedElement per your link above, then using feedItemType attribute to filter "LinkPost". It's not 100% reliable though. – PrawnCrackers Jan 10 '18 at 0:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.