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
Satyendra Singh 15Satyendra Singh 15 

How do i get profile id by name without SOQL

I am trying to get the profile id but without making any SOQL in trigger
Hemant_SoniHemant_Soni
Hi Satyendra,

If you need Current user's profile id then need check this link.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_userinfo.htm

If this answer help's you please mark as best answer.
anil jadhav 8anil jadhav 8
Hi Satyendra,

You can simply use getProfileId() method from UserInfo Class.
e.g. 
Id profileId=userinfo.getProfileId();