function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jwolfjwolf 

Accessing UserRole through UserRole.ParentRoleId relationship

How is field on UserRole ParentRoleId different than any other reference field? I want to make a query to get the name of the parent role, but I get an error that this relationship is not recognized. The query I want to make is this:

 

[select Name, ParentRoleId, ParentRole.Name from UserRole where Id = :someId]

 

 

Is this possible?

Pradeep_NavatarPradeep_Navatar

In my opinion, you can not assign the parentRole.name in SOQL language. It will throw an error.  UseRole standard object does not provide access to parentRole and you can not fetch parent role name.