+ Start a Discussion
SandrineSandrine 

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 Sandrine
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