+ Start a Discussion
sfdc007sfdc007 

How to use the custom label in an render condition for checking the profile

Hi,

I am having a custom label called as "Admins" which contain all the profile names details


i am currently hardcoding my profile in my vf page in the below manner

                <apex:pageBlockSectionItem  rendered="{!IF($Profile.Name!='System Administrator',true,false)}">

rather than doing that can i use my custom label directly for checking the profile


let me know how to proceed

Thanks in Advance


 
Best Answer chosen by sfdc007
Shaijan ThomasShaijan Thomas
<apex:pageBlockSectionItem  rendered="{!IF($Profile.Name!=$Label.<label Name>,true,false)}">
try this
Shaijan

All Answers

KaranrajKaranraj
Use  {!$Label.YourLabelName} in your vf page to get the value
<apex:pageBlockSectionItem  rendered="{!IF($Profile.Name!={!$Label.YourLabelName},true,false)}">

 
Shaijan ThomasShaijan Thomas
<apex:pageBlockSectionItem  rendered="{!IF($Profile.Name!=$Label.<label Name>,true,false)}">
try this
Shaijan
This was selected as the best answer