+ Start a Discussion

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
Query profile name directly from Profile object and use UserInfo.getProfileId()
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!