You need to sign in to do that
Don't have an account?
Giancarlo Amati
How to unpublish a feed comment/item
Hi All,
We are building an Experience Community. We'd like to implement the feature that when a user marks a feed comment/item with "Flag" see snapshot. The item will be unpublished.
I tried to search for example of FeedComment and / or FeedItems, I think this can be done with a FeedItem trigger, but can't figure out hlw.
Thank you for your help.
GC
You can take reference of code snippet from https://help.salesforce.com/s/articleView?id=sf.networks_moderation_flag_triggers.htm&type=5 for fetching flagged posts on FeedItem and FeedComment to get started.
Meanwhile, I am also trying this in my org.Thanks
Thank you, Swetha. Yes, I found that article and I started from there. My understanding however is that the FeedItem doesn't trigger an "update" event when it gets flagged. I understand that the NetworkScope object gets updated. But it's not possible to build a trigger on the NetworkScope object. I wanted to build the query to retrieve the NetworkSope Id record to access the Visibility field with the Developer Console. We did it, but we tried to update the value of the "visibility" field and it generated a DLM error message.
If we have to build a scheduled Apex job that's fine however, If we can make the post hide as soon as it gets flagged, would be ideal.
Thank you,
GC