Custom Label in Apex Class and Vf Page Salesforce

by Rijwan Mohmmed

Hello Friends, today we will learn Custom Label in Apex Class and VF Page(Visualforce Page) Salesforce. We use custom labels for translation text. Custom labels are simple text values that are accessed directly in the Apex class and VF page.

For creating custom labels,
Go To Setup —> Create — > Custom Labels.
Click on New Custom Labels. Enter the value for name, value, and description.
We can use custom label names to access custom label values in apex code using System.Label.labelName

and in Visualforce {!$Label.labelName}

Also Check this: custom label in lightning component

Use Custom Label In Apex :

public class CustomLabelTechdicer{
    public string customLabelValue{get;set;}
    public CustomLabelTechdicer(){

On Visualforce Page :

   <apex:pageMessage severity="info" 

You may also like


Dannielle November 8, 2021 - 6:55 am

I am regular visitor, how are you everybody? This piece of writing posted at this site is in fact fastidious.

Mattie November 10, 2021 - 5:26 am

Greetings from Colorado! I’m bored to tears at work so I
decided to browse your site on my iphone
during lunch break. I enjoy the knowledge you present here and
can’t wait to take a look when I get home. I’m shocked at how
fast your blog loaded on my mobile .. I’m not even using WIFI, just 3G ..
Anyhow, very good site!


Leave a Comment