+ Start a Discussion
ravikanth321ravikanth321 

How to check the Logged In User Profile name in IF Condition..??Without querying the user object.

Prateek Singh SengarPrateek Singh Sengar
Hi Rashmi,
This is not doable without querying in apex however you can find this information in visualforce using
{!$Profile.Name}
SalesFORCE_enFORCErSalesFORCE_enFORCEr
Query profile name directly from Profile object and use UserInfo.getProfileId()
SalesFORCE_enFORCErSalesFORCE_enFORCEr
Profile p = [select id,Name from Profile where id=:Userinfo.getProfileid()];
  if((offerObject.RecordType.DeveloperName == 'ABC) && (p.Name  == 'System Administrator'))
Alekhya Mandadi 8Alekhya Mandadi 8
The above query worked. Thanks!