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
N cN c 

how to add the custom label in an apex class without changing their functionality?

MithunPMithunP
Hi Nar c,

Use the global variable $Label to access the Custom Label value in Visualforce page like below.
<apex:page standardController="Account" extensions="sample">
<h1>Example for Custom labels</h1>
<apex:outputLabel value="{!$Label.Sample}"/>
</apex:page>
Custom labels are called in Apex using System.Label.Label_name.
String samp = System.Label.Sample;

Best Regards,
Mithun.
Shashikant SharmaShashikant Sharma
Not sure what exactly you mean without changing functionality but ot use Lables in apex class you only need.

System.Label.LabelAPIName