You need to sign in to do that
Don't have an account?
Sure@Dream
CreatedBy Id for FeedItem
Hi all,
How to get the createduser's id for a feedItem using ConnectApi?
Using getfeedItemsFromFeed(), I am getting feed from a chatterGroup.
Thanks,
How to get the createduser's id for a feedItem using ConnectApi?
Using getfeedItemsFromFeed(), I am getting feed from a chatterGroup.
Thanks,
I am able to get the feeditem's created user id as follows:
ConnectApi.ActorWithId actorWithId=(ConnectApi.ActorWithId)feedItem.Actor;
String userId=actorWithId.Id;
Thanks.
All Answers
There are mutiple methods available to get feedItem based on feedtype.
ChatterFeeds Methods listed here: https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_ConnectAPI_ChatterFeeds_static_methods.htm
You can use getFeedItemsFromFeed(String, ConnectApi.FeedType, String) which returns the first page of feed items for the specified feed type, for the specified user. The page contains the default number of items.
getfeedItemsFromFeed() will return ConnectApi.FeedItemPage which contains items which of type ConnectApi.FeedItem.
ConnectApi.FeedItem: http://www.salesforce.com/us/developer/docs/dbcom_apex290/Content/connectAPI_outputs.htm#capi_Feed_Item_output
ConnectApi.FeedItem has actor which is the entity that created the feed item.
I am able to get the feeditem's created user id as follows:
ConnectApi.ActorWithId actorWithId=(ConnectApi.ActorWithId)feedItem.Actor;
String userId=actorWithId.Id;
Thanks.