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
chris_parxchris_parx 

FeedItem Bug

I'm doing something simple with FeedItem (API version 23.0)

for(FeedItem fi:[select id from FeedItem]) {

// do something

}

 

and when I want to save, I got this error: "Loop variable must be an SObject or list of FeedItem". !?

 

The same if I want to make something like that:

list<FeedItem> FI = new list<FeedItem>([select id from FeedItem]);

and the error: "Invalid initial value type LIST<FeedItem> for LIST<FeedItem>" .... This does not make much sense!

 

If I indeed use an SObject to init, then it's ok, but getting a blob from a SObject (ContentData field) is impossible...

 

This is obviously a bug.

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

You probably have a class called FeedItem, which is hiding the schema FeedItem type, either rename the class, or use the fully qualified schema feedItem name.

All Answers

SuperfellSuperfell

You probably have a class called FeedItem, which is hiding the schema FeedItem type, either rename the class, or use the fully qualified schema feedItem name.

This was selected as the best answer
chris_parxchris_parx

thank you ... I forgot that ...