Chatter as Field in Opportunity Table

  • 1
  • Question
  • Updated 1 year ago
  • Answered
I have a table that pulls in a bunch of fields off of the opportunity object.  I was wondering if there would be a way to pull in the most recent chatter comment feed related to each record within the table?

I have attached a screen shot that may help portray the functionality that I am aiming to incorporate.
Photo of David Garrity

David Garrity

  • 856 Points 500 badge 2x thumb

Posted 1 year ago

  • 1
Photo of David Garrity

David Garrity

  • 856 Points 500 badge 2x thumb
Photo of David Garrity

David Garrity

  • 856 Points 500 badge 2x thumb
Wanted to follow up to see if anyone has ever attempted this.
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
David,

Add the Chatter feed as a child relationship field to your opportunity model.  Select the Body field from the feed.  Set the 'Feeds' field to return 1 record and order by created date descending.  Then add the child relationship field to your table and display the Body field.  Note that the Body field displays with embedded HTML tags.  You may need to do this with a custom render so you can filter out the HTML.

Thanks,

Bill
Photo of David Garrity

David Garrity

  • 856 Points 500 badge 2x thumb
Bill-

Thank you for the reply.  I was able to create the child relationship field, but when I view it, it is blank as follows:
Photo of Pablo Martinez

Pablo Martinez

  • 2,468 Points 2k badge 2x thumb
Can you show the content of the template field on the table?
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
Photo of David Garrity

David Garrity

  • 856 Points 500 badge 2x thumb
This diagram is helpful in determining the relationship between the salesforce objects.  However, when looking at the potential feed relationships on the opportunity object child relationships, it does not look like the ability exists to "FeedComment" object.
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,040 Points 10k badge 2x thumb
Hi David. I was able to follow Bill's suggestion to display the Body of my Opportunities' most recent chatter posts. Once I dragged the Feeds field to my table, I needed to add {{Body}} to the Template area of the field so the table would know which aspect of the Fields child records to display. 
Photo of David Garrity

David Garrity

  • 856 Points 500 badge 2x thumb
Thank you, that was the piece I was missing!  Now onto a custom render, Bill mentioned a custom render to remove the HTML tags, has anyone completed this before and if so, how did you do it?
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
David,

Take a look at the example page that I posted here-> https://community.skuid.com/skuid/topics/mass-action-create-row-chatter-subscription?topic-reply-lis...

Thanks,

Bill
Photo of David Garrity

David Garrity

  • 856 Points 500 badge 2x thumb
Bill-

Thank you for providing that XML.  With that, I was able to hack something together on the page I am working on. 

The ultimate question I have now is related to the feed.  If chatter is opened, there are "posts" that are not showing in the feed cell on the table.  These "posts" are related to feedtracking within chatter, which appears to be on a different object.  

Does anyone know if the ability exist to show the most recent item that shows in chatter for a record, no matter if it was a post, feedtrack, or something else?
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
David,

Looks like you would need to do some work to get the data together in a single 'column'.  The FeedTrackedChanges object (that holds field changes on a Chatter tracked change) can only be queried via it's child relationship to the Opportunity Feed.  See this page-> http://www.simplysfdc.com/2013/08/salesforce-feedtrackedchange.html

I'd add the child relationship to the OpportunityFeed model and then bring the data into your custom render.  Use the 'Feed Item Type' field to choose what to show.

Thanks,

Bill