+ Start a Discussion
PremInfoPremInfo 

How to filter by Body of FeedItem using Sobject

I am trying to filter based on body of the feedItem table but an Invalid field exception is thrown. Kindly let me know how should I filter by body. I am using SObject in my application. I was able to do the filter on body with version 18 but not in 24. I have mentioned below the code and error message which i got.

 

[code]

connection = Connector.newConnection(config);

QueryResult result = connection.query("SELECT Id from FeedItem WHERE Body like '%testing%' ");

[/code]

 

[error]

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

[/error]

Jia HuJia Hu

Schema.DescribeFieldResult DFR = FeedItem.Body.getDescribe();
System.debug(' ------------------ ' + DFR.isFilterable() );

result:
22:59:51.022 (22803000)|USER_DEBUG|[3]|DEBUG| ----- false

'Body' didn't support Filter!