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
nileshjnileshj 

How to get like count and comment count count for feedpost comments?

Hi ,

I have a query

 

List<NewsFeed>newsFeedList  = [SELECT Id, Type,
                                        CreatedById, CreatedBy.Name,
                                        CreatedDate, LastModifiedDate,
                                        ParentId, Parent.Name, Parent.Type,
                                        RelatedRecordId, CommentCount,LikeCount,
                                        Body, Title, LinkUrl, ContentData, ContentFileName,
                                            (SELECT Id, FieldName, OldValue, NewValue
                                                FROM FeedTrackedChanges ORDER BY Id DESC),
                                            (SELECT Id, CommentBody, CreatedDate,
                                                CreatedBy.Name, InsertedBy.SmallPhotoUrl,FeeditemId
                                                FROM FeedComments ORDER BY CreatedDate DESC LIMIT 2),
                                            (SELECT CreatedBy.Name FROM FeedLikes)
                                        FROM NewsFeed ORDER BY CreatedDate DESC LIMIT 10];

 

 

 

and i want to get like and comment count for current news feed item.

How this can be acheived?