Reputation: 487
I would like to use a SOQL Query to load what is displayed at a user record, what I want to get is the:
I am currently able to retrieve the permission set Related list records for a particular user but I am unable to get the public group and the queue membership related list records,
Here is my query:
SELECT Id, name, (select PermissionSet.Name, AssigneeId
FROM PermissionSetAssignments) from user
Could you please help me adding the missing part in the query to get the queues and the public groups,
Thanks for your help.
Upvotes: 1
Views: 3328
Reputation: 346
You will not get Public group and Queue membership details directly from user object. You need additional query.
SELECT Id, GroupId, UserOrGroupId
FROM GroupMember
WHERE UserOrGroupId IN (SELECT Id FROM User)
Since queue is a public group you don't need additional query to get queue membership. This single query is enough.
Upvotes: 3