Custom Label use in Apex and in VF Page:
String str = Label.Sample;
System.debug('!!!answer!!!'+str);
System.debug('!!!answer!!!'+str);
Use in VF:
<apex:page tabStyle="Account">
<apex:form >
<apex:pageblock >
<apex:outputText value="Value stored in Demo custom label is : "/>
<apex:outputText value="{!$Label.Sample}" style="font-weight:bold"/>
</apex:pageblock>
</apex:form>
</apex:page>
<apex:form >
<apex:pageblock >
<apex:outputText value="Value stored in Demo custom label is : "/>
<apex:outputText value="{!$Label.Sample}" style="font-weight:bold"/>
</apex:pageblock>
</apex:form>
</apex:page>
Reference: https://thesalesforcetutorial.blogspot.com/2023/02/custom-labels-insalesforce.html
Comments
Post a Comment