Another Salesforce blog!!!

Salesforce, Apex

Custom Labels Apex Class


Source Link

In Apex use the System.Label.Label_name syntax.

You can access these custom labels like this:

if(monitoringFrequency == System.Label.daily){
    return dateValue.addDays(1);
}else if(monitoringFrequency == System.Label.weekly){
    return dateValue.addDays(7);
}else if(monitoringFrequency == System.Label.monthly){
    return dateValue.addMonths(1);
}

Leave a Reply

Your email address will not be published. Required fields are marked *

*