You need to sign in to do that
Don't have an account?
SOQL for fetching CommentLikes
Hi,
I have requirement to fetch comment likes. I'm not able to figure out on how to retrieve commentlikes.
FeedLike object represents likes. You can't query FeedLike records directly. They can only be queried via the parent NewsFeed, UserProfileFeed, or entity feed, such as AccountFeed.
So to query FeedPost likes, use following:
SELECT Id, (SELECT Id, CreatedById, CreatedDate, FeedItemId, FeedEntityId FROM FeedLikes) FROM UserFeed
to query group post likes, use following:
SELECT Id, (SELECT Id, CreatedById, CreatedDate, FeedItemId, FeedEntityId FROM FeedLikes) FROM CollaborationGroupFeed
How to retrieve comment likes?
I think the only way you can fetch likes on comments is through the Chatter REST API: http://developer.force.com/chatter-api
That's bad :((
@Chris - Thanks for sharing the info.
But the only problem with using chatter REST API for fetching comment like is that - it needs particular commentid. In such a case, we might end up in querying all comments and then making one call at a time to fetch whether that comment is liked or not. This is not a scalable approach in terms of determining entire org comment likes.
Ya it sounds like in this case it is a bit awkward. By the way, it is possible to get likes for many comments in a feed at once: when you retrieve a specific feed through the Chatter REST API, you receive a page of feed items and each of those feed items includes a page of comments and each comment includes a page of likes.
Could you describe your use case? Exactly what data do you need to retrieve? (just getting a like seems pretty useless if you don' t know what its parent object is) How much of it do you need to retrieve, what are you going to do with it, how often are you retrieving it...
We have a custom object on which feed is enabled and trying to migrate such custom object to another custom object. We are able to migrate FeedItem and its likes along with FeedComment but not able to migrate Likes on FeedComment. So we are kind of stuck, not able to find a way to migrate CommentLikes.