• Anusha Gowravarapu
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hi, I am trying to upsert members to collaboration chatter group but I am receving 
"common.apex.runtime.impl.DmlExecutionException: Upsert failed. First exception on row 0; first error: DUPLICATE_VALUE, User is already a Member of this group" exception.
Can some one suggest how to avoid this.Below is my code
List<DistributionList__c> userID=[SELECT userID__C FROM DistributionList__c where ChatterGroupName__c='testgroup'];
        List<CollaborationGroupMember> CollGroupMembers = new List<CollaborationGroupMember>();
        for(DistributionList__c user : userID)
        {
       
        CollaborationGroupMember member = new CollaborationGroupMember();
        member.MemberId = user.userID__C;
        member.CollaborationGroupId = '0F94D0000004Ebd';
        CollGroupMembers.add(member);
        
        }
        
        try
        {
        
        upsert CollGroupMembers;
        
        }
        catch(DMLException e)
        {
        
        system.debug('The group members werent added properly.  Error: '+ e);
        
        }       
Hi, I am trying to upsert members to collaboration chatter group but I am receving 
"common.apex.runtime.impl.DmlExecutionException: Upsert failed. First exception on row 0; first error: DUPLICATE_VALUE, User is already a Member of this group" exception.
Can some one suggest how to avoid this.Below is my code
List<DistributionList__c> userID=[SELECT userID__C FROM DistributionList__c where ChatterGroupName__c='testgroup'];
        List<CollaborationGroupMember> CollGroupMembers = new List<CollaborationGroupMember>();
        for(DistributionList__c user : userID)
        {
       
        CollaborationGroupMember member = new CollaborationGroupMember();
        member.MemberId = user.userID__C;
        member.CollaborationGroupId = '0F94D0000004Ebd';
        CollGroupMembers.add(member);
        
        }
        
        try
        {
        
        upsert CollGroupMembers;
        
        }
        catch(DMLException e)
        {
        
        system.debug('The group members werent added properly.  Error: '+ e);
        
        }       
Hi All,

I recently had the need to have a public group in which internal users can collaborate with partner users.

I spent quite some time figuring out how to accomplish this. Since there was no documentation (best of my knowledge) I thought I'd share with the rest of you how I did this. 

Logged in as an internal user (e.g. administrator or anywone who can create groups) switch from the internal organization to the community site in the top black bar as shown below:

User-added image

Now create a new group e.g. "General Inquiries" as shown below.

User-added image

This group is now available for internal and partner community users.

Please note, in order for internal users to access the group and collaborate with partners, they need to first switch to from the internal org to the community as shown in the first picture.

Also when users or partners submit a post, make sure they select the proper group if this is not already selected:

User-added image

Hope this helps anyone out there, also if you know a better way to do this please share!

Gerko