Skip to main content Stream TDX Bengaluru on Salesforce+. Start learning the critical skills you need to build and deploy trusted autonomous agents with Agentforce. Register for free.
Hi, so I am under the assumption that in a VisualForce (VF) page/Apex I can type "$User.FirstName" to get first name of the current user. Additionally, I can do "$User.Email" and "$User.LastName" to get the current user's email and last name.

 

I was wondering if anyone knew of a website I can go to see how I can get access to other user fields? For example, I also want to grab the office, location, and department office ID of the current user.

 

I have tried to do "$User.Office", "$User.location", and "$User.DeptID", but to no avail. Those three cause errors
2 answers
  1. Jan 15, 2013, 12:57 AM
    Hi Rajwinder,

     

    You just need to get the API field names. To access custom and standard field names do the following

     

    >Setup>Customize>Users>Fields

     

    There you will see the list of fields that you can select from.

     

    For instance,

     

    Department would be 

     

    $User.Department

     

    Best of luck!
Loading
0/9000