function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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