Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

How to use an apex custom label in class?

Asked by Ava Black May 12, 2023 1.0K views 1 answer
Share

About this question

I have the below If statements using some hard coded strings and I want to make them use as custom labels. I have created custom labels with the same String names as given below. So how can I make these statements to use the Custom Labels I created ?

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

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.