When I try to use in VisualForce page apex variable which references hierarchy custom setting, it is possible to save the page but it is not possible to deploy that page to production or another sandbox or organization.
<apex:page >
<apex:variable var="isAdmin" value="{!CONTAINS($Profile.Name, 'System Administrator')}" />
<apex:variable var="profileWasGivenAccess" value="{!CONTAINS($Setup.SomeHierarchyCustomSetting__c.CommaSeparatedListOfProfileIds__c,$Profile.Id)}" />
<apex:outputPanel rendered="{!isAdmin}">
X<br/>
</apex:outputPanel>
=== Text between X and Y ===<br/>
<apex:outputPanel rendered="{!OR(profileWasGivenAccess,isAdmin)}">
Y<br/>
</apex:outputPanel>
=== Text between Y and Z ===<br/>
<apex:outputPanel rendered="{!OR(profileWasGivenAccess,isAdmin)}">
Z
</apex:outputPanel>
</apex:page>
Does anyone knows a workaround for this?
Should I open a Salesforce support case for this?
Or should I add idea to IdeaExchange for salesforce to fix this?
Deployment error message is following:
*********** DEPLOYMENT FAILED ***********
Request ID: 0AfE000000SoMe_Id
All Component Failures:
1. pages/var.page -- Error: Unknown property 'profileWasGivenAccess' referenced in var
*********** DEPLOYMENT FAILED ***********