Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Chatter Development
- :
- Query only returns one comment
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Query only returns one comment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-04-2012 08:51 AM
I'm doing a query for chatter that looks like this:
[SELECT Id, Type, CreatedDate, CreatedById, CreatedBy.FirstName, CreatedBy.LastName, ParentId, Body, Title, LinkUrl, ContentData, ContentFileName ,
(SELECT Id, CommentBody, CreatedDate, CreatedBy.FirstName, CreatedBy.LastName FROM FeedComments LIMIT 5)
FROM FeedItem WHERE ParentID =: objectId AND Type = \'TextPost\' ORDER BY CreatedDate DESC LIMIT 10]
The problem is that the query only returns one comment even though I specify a limit of 5 and I know there are more than 5 comments on the chatter post that I'm rendering. Any insights into why that might be?
Thanks!
Scott
Re: Query only returns one comment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-04-2012 05:48 PM
... from feeditem where commentcount > 3 ....
and see what you got
Re: Query only returns one comment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-04-2013 06:06 AM
So the using commentcount > 2 returns the item but still there is only one comment returned. The weird thing is the totalSize of the comment records is correct. Here's what the JSON output is for the comments.
"FeedComments":{"totalSize":4,"done":false,"record
So it seems like done:false means it hasn't retrieved all the comments. Is there any way to force it to retrieve more than one comment? Or am I doomed to only showing one comment for each chatter post initially with a more link that retrieves the rest if there is more than one?
Re: Query only returns one comment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-10-2013 05:21 PM
If you want to retrieve the Body part, you have to put the query in a loop way.

