0
votes

I am trying to get just get the permissionSetGroupComponents for test users in Salesforce with this query.

SELECT AssigneeId, IsActive, ExpirationDate, PermissionSetGroupId, PermissionSetId FROM PermissionSetAssignment WHERE User.FirstName = 'Test'

But when I run that I get this error.

PermissionSetAssignment WHERE User.FirstName = 'Test'
                          ^
ERROR at Row:1:Column:119
Didn't understand relationship 'User' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

According to the API documentation there is a relationship between the two objects so I don't understand why it cannot find the relationship. https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_permissionsetassignment.htm

1

1 Answers

1
votes

User is not the name of the relationship. The relationship field is AssigneeId, so the relationship field is Assignee:

SELECT AssigneeId, IsActive, ExpirationDate, PermissionSetGroupId, PermissionSetId 
FROM PermissionSetAssignment 
WHERE Assignee.FirstName = 'Test'