Loading

SOQL cannot fetch Chatter from FeedPost objects

Udgivelsesdato: Mar 16, 2023
Beskrivelse

Chatter feed information cannot be retrieved from the FeedPost object using SOQL (Salesforce Object Query Language). Running a query against FeedPost, such as the example below, results in an error.

 

Example query:

SELECT ParentId, Body, Type FROM FeedPost

 

Resulting error:

INVALID_TYPE_FOR_OPERATION: entity type FeedPost does not support queries

Løsning

This error occurs because the FeedPost object does not support SOQL queries at all — it's a legacy Chatter feed object that was never built to be queried directly.

Why FeedPost Cannot Be Queried

FeedPost has been phased out by Salesforce and is not supported for SOQL operations. See the FeedPost object reference for details.

Recommended Approach: Use FeedItem

Salesforce recommends using the FeedItem object instead. FeedItem supports SOQL queries, so you can retrieve Chatter feed data such as post body, type, and parent record. See the FeedItem object reference for the full field list and query examples.

Example

For example, if you're building an integration or report that needs to pull Chatter post content for a record, query FeedItem instead of FeedPost:

 

SELECT ParentId, Body, Type FROM FeedItem

Vidensartikelnummer

000384407

 
Indlæser
Salesforce Help | Article