You need to sign in to do that
Don't have an account?
mcowger
Bad Filter for NewsFeed?
Hi,
I'm trying to develop something quick to pull some FeedPosts and am looking at the Recipes provided. The SOQL for pulling all your items specifies the following in the WHERE claus:
AND FeedPost.Body != ''
However, if I include that in my SOQL call below
query = "SELECT Id, CreatedById, CreatedBy.FirstName, CreatedBy.LastName, FeedPost.Body FROM NewsFeed WHERE CreatedById != '" + id + "' ORDER BY CreatedDate DESC, ID DESC LIMIT 20"
I get an error:
MALFORMED_QUERY: Illegal filter on NewsFeed
I actually get this anytime I try to filter on any part of the 'FeedBody' Object. Thoughts/Ideas? It is important to me to be able to filter on the Body (so that I can filter out Posts that are only Links, etc).
The following query works fine for me:
Do you have 'with sharing' on your class definition by any chance?
If you want just text posts, then "WHERE Type = 'TextPost'" would do it and is more efficient than filtering on the Body.
The current values for Type are: TrackedChange, UserStatus, TextPost, ContentPost, and LinkPost.