0

Currently am making two calls to salesforce API to fetch the data, below are the two queries:

1>SELECT PermissionSetAssignment.AssigneeId,PermissionSetAssignment.PermissionSet.Name FROM PermissionSetAssignment where PermissionSetAssignment.PermissionSet.IsOwnedByProfile=false  order by PermissionSetAssignment.AssigneeId

2>SELECT UserOrGroupId,Group.Name FROM GroupMember  order by UserOrGroupId

Can we have a single query instead of two?

Please help Salesforce GURU's.

ρss
  • 5,115
  • 8
  • 43
  • 73

2 Answers2

0

If you have a relation between these tables you can directly fetch the UserOrGroupId in the first query itself

Maddy
  • 85
  • 11
  • Thanks Maddy for the update much appreciated. Just wanted to know how could we know if there is any relation between the above mentioned tables (PermissionSetAssignment and GroupMember)? – Neelmani Ghimire Jan 10 '16 at 10:02
  • see if there is a lookup field in any of the tables – Maddy Jan 11 '16 at 08:19
0

There is no relation between Permission Set Assignment and Group Member. So you have to use two query and you wont be able to do it in one query.

Head In Cloud
  • 2,001
  • 1
  • 8
  • 10