function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jonathan Wolff 7Jonathan Wolff 7 

Only title and author in Chatter Component

Hi,
I want to build a chatter component so it only shows the last 5 messages with only title and author. Can I do it and even change it that it only shows specific (i.e. to me) messages?

Thank you :)
Jonathan
ANUTEJANUTEJ (Salesforce Developers) 
Hi Jonnathan,

>> https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_feeditem.htm

You can make use of FeedItem object that stores the entry in the feed, you can use InsertedById and title to get the title and author and you can show them in a table in lightning component.

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.
Jonathan Wolff 7Jonathan Wolff 7
Can you give me a code example how to do it? I'm new to SF and I dont know how to build it
ANUTEJANUTEJ (Salesforce Developers) 
Apologies for the delayed response, I see that there is another question and I see the answer posted over there worked.

Posting the same answer here for other to check in case if they face a similar issue.

I believe this is possible and you'd need to target FeedComment as per the diagram shown on the below page 

https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_erd_chatter.htm

Below is the link to the Developers Guide on the Objects stored under each Feed Object for example Account_Feed etc

https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_feed.htm

You can look at the sample chatter component here as well 

Let me know if this helps, if it does, please mark this answer as best so that others facing the same issue will find this information useful. Thank you