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
SURESH COOLSURESH COOL 

apex

 

 

HOW WE KNOW LOGED IN USER PROFILE NAME IN APEX?

 

bob_buzzardbob_buzzard

No need to shout :)

 

You get the id from UserInfo and then the name via a SOQL query. Something like:

 

Id profileId=UserInfo.getProfileId();
Profile p=[select Name from Profile where id=:profileId];

 

SURESH COOLSURESH COOL

Thanx bob

 

 

 

vbsvbs

As an alternative if used in VF pages then:

 

$Profile.Name