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
AbAb 

displaying user profile without querying in apex

Hello,

Is it possible to detect the profile name of user directly in VF page without querying inside apex ?

tanks for suggestion !
Best Answer chosen by Ab
brahmaji tammanabrahmaji tammana

Hi Sandrine,

Yes it is possible. You can try using global variables in the page.
To get the profile name of current user use below:

Profile Id: {!$Profile.Id}
Profiel Name: {!$Profile.Name}

To get user details:

{!$User.Name} - Name
{!$User.CompanyName} - Company Name & etc

Hope it helps.

Thanks

Brahma

All Answers

sfdcMonkey.comsfdcMonkey.com
hi sandrine
you can use {!$Profile.Id} {!$Profile.Name} for get current user profile name or id in visualforce page
i hope it helps you
thanks
brahmaji tammanabrahmaji tammana

Hi Sandrine,

Yes it is possible. You can try using global variables in the page.
To get the profile name of current user use below:

Profile Id: {!$Profile.Id}
Profiel Name: {!$Profile.Name}

To get user details:

{!$User.Name} - Name
{!$User.CompanyName} - Company Name & etc

Hope it helps.

Thanks

Brahma

This was selected as the best answer
sfdcMonkey.comsfdcMonkey.com
and also keep in mind that  you can’t use the following $Profile values in Visualforce:
LicenseType
UserType