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

Implementation restriction: FeedItem requires a filter by Id



I'm getting the following error: Implementation restriction: FeedItem requires a filter by Id.

For custom standard user profiles.

For system admin i'm not getting this error.


Following is the code that i"ve implemented:


public List<FeedItem> getChatterCount() {

return [select id from FeedItem where parentID =: ApexPages.currentPage().getParameters().get('id')];


Pls. suggest



Neha G Patel


From the error message, my guess is that you don't have an id value in your parameters.


I am getting the same error for slandered user. Did you get this resolved?


I'm having the same issue. It involves working with the Email Attachments app from CRM guidance. I'd love to find out how to fix it.


Any progress yet?


It is too old post to reply. But in case somebody else is looking at it..


Cause of this error :- is that you have declared the class where this query exist as "with sharing" and all the feed item queries in a class "with sharing" requires an feed item id in the filter. 


Fix: Move the query part to a separate utility like FeedItemQueryUtils and make a static method to do the query. Mark the FeedItemQueryUtils class as without sharing (not mention anything about sharing - default is without sharing)



Vikash AgarwalVikash Agarwal
It's too old post to reply but in case looking for it ...

I also got stucked in FeedItem query
"Select Parent.Id, ParentId, LinkUrl, Id,ContentFileName, RelatedRecordId From FeedItem where ParentId=:objectId and type='ContentPost' Limit:recordLimit"

and it was showing error(Implementation restriction: FeedItem requires a filter by Id) for "Chatter Only user " profiles.
So after some RND we can modify our query by querying it from "CollaborationGroupFeed" and query looks like

"[Select Parent.Id, ParentId, LinkUrl, Id,ContentFileName, RelatedRecordId From CollaborationGroupFeed where ParentId=:objectId and type='ContentPost' Limit:recordLimit];"
and now it's working fine for all profiles.