0

I would ask if I can disable the Chatter mention in a standard way or I must use a custom solution as a Trigger.

1

At the moment, Apex Triggers is the only option AFAIK to restrict mention on user/group level.

Suggestion: Use hierarchical custom setting to make the user/profile configurable.

There is [would be] a feature available for groups:

  1. Keep Discussions Focused with Broadcast Groups—Generally Available
  2. Broadcast Groups—Pilot
| improve this answer | |
0

I wrote two triggers, on FeedItem and FeedComment.

FeedItem Trigger:

trigger MentionFeedItem on FeedItem (before insert, before update) {

List<User> listUserPlatform = [SELECT ID, Name FROM User];
List<String> listNameUserPlatform = new List<String>();

for(User u : listaUserPlatform) {
    listNameUserPlatform.add('@'+u.Name);
}

for(FeedItem f : Trigger.new) {
    Boolean nameFinded = false;
    for(Integer i=0; i < listNameUserPlatform.size() && !nameFinded; i++) {
        if( f.Body.contains(listNameUserPlatform.get(i)) ) {
            nameFinded=true;
            f.addError('You can\'t use mention');
        }
    }
}

FeedComment trigger:

trigger MentionFeedComment on FeedComment (before insert, before update) {

List<User> listUserPlatform = [SELECT ID, Name FROM User];
List<String> listNameUserPlatform = new List<String>();

for(User u : listaUserPlatform) {
    listNameUserPlatform.add('@'+u.Name);
}

for(FeedComment f : Trigger.new) {
    Boolean nameFinded = false;
    for(Integer i=0; i < listNameUserPlatform.size() && !nameFinded; i++) {
        if( f.CommentBody .contains(listNameUserPlatform.get(i)) ) {
            nameFinded=true;
            f.addError('You can\'t use mention');
        }
    }
}

}

Thanks :)

| improve this answer | |
0

To basically disable mentions in Salesforce Communities specifically:

1.) In Setup ---> Sharing Settings, Set the Default External Access "Users" to private.

2.) In Setup ---> Sharing Settings, Uncheck both "Portal User Visibility" and "Community User Visibility" checkboxes.

Disable mentions salesforce communities

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.