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
KhaledZeroKhaledZero 

Disable comment and like in posts whith trigger?

Hi,

how i can use trriger to disable comments ans likes in a posts of an group

ps:
when i want bloc posts in an group i use 

trigger GroupReadOnly on FeedItem (before insert, before delete)

 thx.

alouie_sfdcalouie_sfdc
For comments, you can do the same thing you're doing in your example, except with the FeedComment object instead of the FeedItem object.

I don't think you can use a similar technique for likes because they're not triggerable.
KhaledZeroKhaledZero

hi,

there is solution to bloque all changement in some of groups like groups Name.contains('Inactif') ?

Thx