Right now I have to use SOQL statement and its killing me.
private static final Id SYS_ADMIN_PROFILE_ID = [select ProfileId from User where Profile.Name = 'System Administrator'].ProfileId; ... If(UserInfo.getProfileId() == SYS_ADMIN_PROFILE_ID ){ /** your code **/ }
Regards,
Gaurav3 件の回答
I am able to get create a formula field that has the value of the current user profile name( $Profile.Name )on the object. However, I am not able to get the value of that field in apex script. I am using following script:
It returns Null valueAny suggestionString userProfile =Apexpages.currentPage().getParameters().get('Current_User_Profile__c');