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
saritha78saritha78 

How to get userprofile

Hi,
I am trying to get the user profile name of the user who is logged in. I am using the retrieve method as
 
sObject[] userprofile=binding.retrieve("Username, ProfileId", "User", userid);
 
Then I use the profile ID to get the profile name. This works fine as long as the user who is logged in is system admn. How do I set securities if the user logged in is a standard user. Because, for a standard user, it gives the error that ProfileId is an invalid column. I am assuming that this error has to do with some field level securities. But its not possible to change the field level securities on the User object.
 
Any thoughts?
Thanks,
Saritha