0

I was going through documentation of FeedItem where for Status field it mentions:

These permissions do not apply when you retrieve feed items using SOQL. To filter out Pending Review feed items you must add an explicit clause.

Here is Screenshot. enter image description here

Here is link to doc

I need to filter out PendingReview FeedItems using soql

SELECT Id FROM FeedItem WHERE Status != 'PendingReview'

returns error

^ ERROR at Row:1:Column:31 field 'Status' can not be filtered in a query call

1 Answer 1

1

The FeedItem status field doesn't support the filter option. FeedItem Status Field Properties

You can use the following code as a workaround:

List<FeedItem> feedItems = new List<FeedItem>();
for(FeedItem fi : [SELECT Id, Status FROM FeedItem]) {
if(fi.Status.contains('PendingReview')) { // Any status
    feedItems.add(fi);
    }
}
System.debug(feedItems);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .