You need to sign in to do that
Don't have an account?
Chermadurai
Display Message According to Profile
Hi..my reqirement is if he is an administrator need to display ' U r Admin' else ' U r not an Admin'...
Is it possible???
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Hi..my reqirement is if he is an administrator need to display ' U r Admin' else ' U r not an Admin'...
Is it possible???
Could u pls specify whether u want that messsage to be displayed on vf /standard page?
Samreet,
in vf only..
In the Controller/Extension You can use the following method to query the current user profile.
String profileId= UserInfo.getProfileId();
Obtain the profile id of the current user then query the profile object like-
Profile currentUserProf= [select name from Profile where id =:profileId limit 1].
Then use a boolean variable to identify if user is admin or not.
Boolean isAdmin;
if(currentUserProf != null){
if(currentUserProf.name.equalsIgnoreCase('System Administrator'))
isAdmin = true;
else
isAdmin =false;
}
Then render a component on page like
<apex:outputLabel value="U r Admin" renderered="{!isAdmin}"/>
<apex:outputLabel value="U r not Admin" renderered="{!NOT(isAdmin)}"/>
}
Thanks Samreet..