UserInfo Class In Salesforce!
UserInfo contains methods for obtaining information about the context user.
The following are methods for UserInfo. All methods are static.
getDefaultCurrency()
Returns the context user's default currency code for multiple currency organizations or the organization's currency code for single currency organizations.
getFirstName()
Returns the context user's first name.
getLanguage()
Returns the context user's language.
getLastName()
Returns the context user's last name.
getLocale()
Returns the context user's locale.
getName()
Returns the context user's full name.
The format of the name depends on the language preferences specified for the organization.
getOrganizationId()
Returns the context organization's ID.
getOrganizationName()
Returns the context organization's company name.
getProfileId()
Returns the context user's profile ID.
getSessionId()
Returns the session ID for the current session.
getTimeZone()
Returns the current user’s local time zone.
getUiTheme()
Returns the preferred theme for the current user.
Use getUiThemeDisplayed to determine the theme actually displayed to the current user.
getUiThemeDisplayed()
Returns the theme being displayed for the current user.
getUserEmail()
Returns the current user’s email address.
getUserId()
Returns the context user's ID.
getUserName()
Returns the context user's login name.
getUserRoleId()
Returns the context user's role ID.
getUserType()
Returns the context user's type.
hasPackageLicense(packageId)
Returns true if the context user has a license to the managed package via a package license only. Otherwise, returns false.
isCurrentUserLicensed(namespace)
Returns true if the context user has a license to any managed package denoted by the namespace. Otherwise, returns false.
isCurrentUserLicensedForPackage(packageID)
Returns true if the context user has a license to the managed package denoted by the package ID.
Otherwise, returns false. If the context user has access, it’s determined either via the package license or a namespace permission set license for the package namespace.
isMultiCurrencyOrganization()
Specifies whether the organization uses multiple currencies.
Follow Us