'I want FeedItem/FeedComments to be Approved using Apex Salesforce how can we achieve it?
I am trying to approve feedItem/feedcomment using Apex but I am not able to create an Approval Process for them. So an idea of how we can submit feed records for Approval.
Solution 1:[1]
FeedItem has a status field with two values PendingReview and Published. Change status to Published to approve them. Example:
List<FeedItem> feedItems = new List<FeedItem>();
for(String feedId : feeds){
if(doApprove){
feedItems.add(new FeedItem(Id=feedId,Status='Published'));
}
}
Database.SaveResult[] srList = Database.update(feedItems, false);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | AmanSharma |