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
Alexander RochaAlexander Rocha 

Visualforce Chatter/Feed funcionality

Hi everyone,

I have a problem here.
I'm trying to implement a feed functionality(Chatter) in my visualforcePage, using the feedItem object.
I followed this tutorial https://developer.salesforce.com/page/Chatter_Code_Recipes (Recipe 6) and everything runs very well.
But I want to add the flag (feed) functionality, how can I do this? (With this the "Moderator" can filter the bad feeds)
I looked FeedItem fields and I didn't find any "flag" field.

Sorry my bad english.


Alexander Santos Rocha
logontokartiklogontokartik
You can add flag using the CommunityModeration class in ConnectAPI namesapce. (please note with API V 32.0 a lot of stuff has been changed in ConnectAPI)

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_ConnectAPI_CommunityModeration_static_methods.htm#apex_ConnectAPI_CommunityModeration_addFlagToFeedItem

 
Alexander RochaAlexander Rocha
Thank you.

But I got a error Exception "Resource not found".

I debug the parametter and everything is right.

Alexander Santos Rocha

 
Alexander RochaAlexander Rocha
Hi again,

I can get the feedItem with the same parameters (CommunityId, feedItemId), but I can't flag it.
"Resource Not Found" pops in my debug.
I already set the flag permission in my community

Thank you for your attention
Alexander Santos Rocha
 
logontokartiklogontokartik
Can you please check and let me know what API version you are using for the class? 31.0 or 32.0?
Alexander RochaAlexander Rocha
Sure.

31.0