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
Greg HGreg H 

ProfileId on User object

I have an sControl where I need to filter down all the roles rolling up to a person in the role hierarchy in a very large org.  After I filter down the valid roles of people rolling up to the user, I then want to look at the profiles of each of those people to exclude some specific profiles from the sControl details.
 
I am encountering a problem with the sControl when I query the profileid from the user object.  Since the query is running for the user and not me (as an admin), I am seeing errors.  The faultstring I am receiving is that the field profileid is not valid for user.
 
I think this is a bug because all users have access to user records.  Does anyone know of an easy work-around for me to get profileid for an array of users?
-greg
Greg HGreg H

I really thought that access to profileId was an enhancement in the Winter release but it turns out that this is not so.  I will simply create a custom field on the user record to fix this issue.  Please use the link below to vote for this enhancment in a future release:

http://ideas.salesforce.com/article/show/56890/Ability_to_reference_User_object_field_values_ie_Profile_Id_in_Field_Validations_even_if_the_user_doesnt_have_access_to_view_the_organizations_setup_and_configuration

Thanks,
-greg
SuperfellSuperfell
getUserInfo will tell you the users profileId, but you can't access a random users profileId unless you're an admin.