Monday, September 15, 2014

Getting the current profile of user or checking the current profile of the user !

Hi below I have described how can u do a simple profile check on the user without creating any id list or set
//Creating a list to get the current user via the UserInfo.getProfileId()
List pro = [SELECT id,Name FROM Profile  where id = :UserInfo.getProfileId()];

//checking the profile via the name
if(pro[0] != null &&  pro[0].name.contains('Profile name'))

//

No comments:

Post a Comment