Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

GroupMember Types of a Public Group

Asked by Carol Bower Apr 23, 2021 2.3K views 1 answer
Share

About this question

How can we get the Type of a Group Member?

Using getSObjectType() on the UserOrGroupId of GroupMember we get the Types - but they are only User or Group.

List members = [ SELECT Id, UserOrGroupId FROM GroupMember WHERE GroupId IN (SELECT id FROM Group where Id = :groupId) ]; for(GroupMember member: members) { System.debug(member.Id.getSObjectType() + '-' + member.UserOrGroupId.getSObjectType()); }

enter image description here

Any help/suggestions will be appreciated. What are all types of group members?

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.