You need to sign in to do that
Don't have an account?
MrHammy
How do I use getFeedElementsFromFeed
I am trying to replace a chatter feed I use in a VF page, in the past I used
But that has gone away in api 31 (it also just broke on its own somehow) and I want to use the most up-to-date way of getting the data. I am getting the error Line: 6, Column: 90 unexpected token: ',' when I try and run this in execute anonymous,
I can find no real world examples of how to do this
return ConnectApi.ChatterFeeds.getFeedItemsFromFeed(communityId, ConnectApi.FeedType.Record, groupId).items
But that has gone away in api 31 (it also just broke on its own somehow) and I want to use the most up-to-date way of getting the data. I am getting the error Line: 6, Column: 90 unexpected token: ',' when I try and run this in execute anonymous,
private static List<Community> customCommunity = [Select NetworkId, Name From Community where name = 'Sales Community']; private static String communityId = customCommunity[0].NetworkId; private static List<CollaborationGroup> CollaborationGroup = [SELECT Id FROM CollaborationGroup where name = 'Agency Forum']; private static String groupId = CollaborationGroup[0].Id; public static ConnectApi.FeedElementPage ConnectApi.getFeedElementsFromFeed( communityId , ConnectApi.FeedType.Record , groupId);
I can find no real world examples of how to do this
In API versions 30.0 and earlier, a Chatter feed was a container of feed items. In API version 31.0, the definition of a feed expanded to include new objects that didn’t entirely fit the feed item model. The Chatter feed became a container of feed elements. The abstract class ConnectApi.FeedElement was introduced as a parent class to the existing ConnectApi.FeedItem class. The subset of properties that feed elements share was moved into the ConnectApi.FeedElement class. Because feeds and feed elements are the core of Chatter, understanding them is crucial to developing applications with Chatter in Apex. For detailed information, see Working with Feeds and Feed Elements.
Please follow the below link for more info
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_ConnectAPI_ChatterFeeds_static_methods.htm
Best Regards
Naga Kiran