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 

How to get the list of managers of a group?

Hi,

using apex code in salsesForce

CollaborationGroup gp = [Select OwnerId, Id From CollaborationGroup Where Name = 'Group_ReadOnly'];

 

how to get the list of managers of a group?

Thx.

Best Answer chosen by Admin (Salesforce Developers) 
alouie_sfdcalouie_sfdc

You need to query on the CollaborationGroupMember SObject:

 

SELECT MemberId FROM CollaborationGroupMember WHERE CollaborationGroupId='your_group_id' AND CollaborationRole='Admin'

 

Docs:

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_collaborationgroupmember.htm

 

Note: I think there's a bug in the documentation. The valid values for CollaborationRole are 'Standard' and 'Admin', not 'Member' and 'Manager'.