Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
$User
A global merge field type to use when referencing information about the current user.
User merge fields can reference information about the user such as alias, title, and ID.
Most of the fields available on the User standard
object are also available on $User.
Usage
Use dot notation to access the current user’s information. For
example:
1{!IF (CONTAINS($User.Alias, Smith) True, False)}Example
The following example displays the current user’s company name, as well as the status
of the current user (which returns a Boolean value).
1<apex:page>
2 <h1>Congratulations</h1>
3 This is your new Apex Page
4 <p>The current company name for this
5 user is: {!$User.CompanyName}</p>
6 <p>Is the user active?
7 {!$User.isActive}</p>
8</apex:page>