You need to sign in to do that
Don't have an account?
Kenny Jacobson
Thoughts?
Custom Labels as Custom Global Variables
I have a client that is using Custom Labels as their own custom global variables (or "properties" or "name/value pairs" whatever you want to call them). I'm just wondering if this is a common practice? Are there any drawbacks? It seems pretty ingenious to me, I had just never seen it before.
Here is an example of what I'm talking about:
Create a new Custom Label with Name = "Global_PublicKey" and Value="1234xyz"
So in Apex you just reference the value as Label.Global_PublicKey
private boolean isAuthorized(){ String qPublickKey = ApexPages.currentPage().getParameters().get('publicKey'); return qPublickKey.contains(Label.Global_PublicKey); }In a VisualForce page you refence it {!$Label.Global_PublicKey}:
<apex:page sidebar="false" showHeader="false" > <apex:pageBlock title="Test"> Global Variable PublicKey = {!$Label.Global_PublicKey} </apex:pageBlock> </apex:page>
Thoughts?
Suneel#8
I think you can make use of Custom Labels this way, if your application is not multi lingual and you are not using Custom Labels for translation