You need to sign in to do that
Don't have an account?
nikita dhamal
Compile Error: sObject type 'NewsFeed' is not supported. at line 50 column 33
I have written used the below code in my apex class and got hte error : " Compile Error: sObject type 'NewsFeed' is not supported"
public List<NewsFeed> getNewsFeed() { // Retrieving all feeds form Newsfeed
List<NewsFeed> myfeed = [SELECT Id, Type,
CreatedById, CreatedBy.FirstName, CreatedBy.LastName,CreatedDate,
ParentId, Parent.Name,
Body, Title, LinkUrl, ContentData, ContentFileName,
(SELECT Id, FieldName, OldValue, NewValue
FROM FeedTrackedChanges ORDER BY Id DESC),
(SELECT Id, CommentBody, CreatedDate,
CreatedBy.FirstName, CreatedBy.LastName
FROM FeedComments ORDER BY CreatedDate LIMIT 10),
(SELECT CreatedBy.FirstName, CreatedBy.LastName
FROM FeedLikes)
FROM NewsFeed
ORDER BY CreatedDate DESC, Id DESC
LIMIT 20];
return myfeed;
}
can anyone teel me solution to remove this error??
public List<NewsFeed> getNewsFeed() { // Retrieving all feeds form Newsfeed
List<NewsFeed> myfeed = [SELECT Id, Type,
CreatedById, CreatedBy.FirstName, CreatedBy.LastName,CreatedDate,
ParentId, Parent.Name,
Body, Title, LinkUrl, ContentData, ContentFileName,
(SELECT Id, FieldName, OldValue, NewValue
FROM FeedTrackedChanges ORDER BY Id DESC),
(SELECT Id, CommentBody, CreatedDate,
CreatedBy.FirstName, CreatedBy.LastName
FROM FeedComments ORDER BY CreatedDate LIMIT 10),
(SELECT CreatedBy.FirstName, CreatedBy.LastName
FROM FeedLikes)
FROM NewsFeed
ORDER BY CreatedDate DESC, Id DESC
LIMIT 20];
return myfeed;
}
can anyone teel me solution to remove this error??
NewsFeed is available in API version 18.0 through API version 26.0. In API version 27.0 and later, NewsFeed is no longer available.
Thanks,
Thiyagarajan Selvaraj.
NewsFeed is available in API version 18.0 through API version 26.0. In API version 27.0 and later, NewsFeed is no longer available in the SOAP API. Use the Chatter REST API to access NewsFeed.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_newsfeed.htm
-Thanks
Ashlekh Gera