Id profileId=userinfo.getProfileId();
String profileName=[Select Id,Name from Profile where Id=:profileId].Name;
system.debug('ProfileName'+profileName);
public googlePageController(){
PageReference pg = null;
String usr = AF_DealerCRM_Utility.getUserInfo();
System.debug (' ProfileName: ' + usr);
}
public string getUserInfo(){
String usrProfileName = [select u.Profile.Name from User u where u.id = :Userinfo.getUserId()].Profile.Name;
return usrProfileName ;
}
(OR)
public googlePageController(){
PageReference pg = null;
User usr = AF_DealerCRM_Utility.getUserInfo();
System.debug (' ProfileName: ' + usr.Profile.Name);
}
public User getUserInfo(){
User usrProfileName = [select u.Profile.Name from User u where u.id = :Userinfo.getUserId()];
return usrProfileName ;
}
please select this as solution if you got your answer.