You need to sign in to do that
Don't have an account?
Tillu
How to disable chatter posts for users ?
is it possible to disable certain users from commenting to chatter posts. I have tried a trigger but how to include profile id for this ?
I have tried but i don't think it gonna work..the user able to post on chatter..i want to restrict from profile.
trigger FeedCommentBefore on FeedComment(Before Insert) {
Id profileUser = UserInfo.getProfileId();
profile AnnuityProfile = [select id from profile where name = 'Annuity External Wholesaler'];
for(FeedComment fc : trigger.new)
if(fc.CommentType== 'ContentComment' && ProfileUser == AnnuityProfile.Id)
fc.addError('you dont have permissions to Comment');
}
I have tried but i don't think it gonna work..the user able to post on chatter..i want to restrict from profile.
trigger FeedCommentBefore on FeedComment(Before Insert) {
Id profileUser = UserInfo.getProfileId();
profile AnnuityProfile = [select id from profile where name = 'Annuity External Wholesaler'];
for(FeedComment fc : trigger.new)
if(fc.CommentType== 'ContentComment' && ProfileUser == AnnuityProfile.Id)
fc.addError('you dont have permissions to Comment');
}
Your trigger is working perfect, have you tried comment with uploading attachment.
You are checking comment type with "ContentComment" so try to upload attachment it will restrict the user and if you want to restrict the user from commenting text also than try this:
If this solves your problem, kindly mark it as the best answer.
Thanks,
Vatsal