0

I have a question around the SOQL query below.

SELECT Assignee.Name, Assignee.Profile.Name, Assignee.UserRole.Name, Assignee.Profile.UserLicense.Name FROM PermissionSetAssignment WHERE PermissionSet.Name = 'Lightning_Experience_User'

Why is it that I have to use assignee.blah and why can't I use user.blah in the query?

My query returns the result below, notice the tab shows User.Name, User.UserRole.

Whereas I can use the object API names for other objects such as Profile and UserLicense.

enter image description here

I hope that makes sense what I am trying to explain.

Thank you

3
  • 2
    The PermissionSetAssignment object does not have any field by the name User. The field reference to User object is named as Assignee. Apr 21, 2022 at 0:46
  • When I look at the documentation here, I don't see a Assignee field rather the AssigneeId. developer.salesforce.com/docs/atlas.en-us.object_reference.meta/… Apr 21, 2022 at 1:36
  • 1
    Ok, I THINK I see where I got confused I didn't know about the 'Relationship Name' Is that correct? Apr 21, 2022 at 1:40

1 Answer 1

0

PermissionSetAssignment object Represents the association between a User and a PermissionSet. This object is available in API version 22.0 and later.

PermissionSetAssignment object have the relationship field with Assignee instead of user to the user object, that is the reason you can't able to use the user in the soql query of PermissionSetAssignment object.

check the PermissionSetAssignment object Reference

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .