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