0

Hii I need to use a custom label in my onClick javascript button.

I am getting an error

Field $Label.Label does not exist. Check spelling.

Though I have already Created the Custom Label

The label I am using is like

alert('{!$Label.Tax_Code_Input}');

and it should display the word

GST out 10%

as an alert .Please guide me how to use a custom label in javascript

3
  • This should work.
    – Reshma
    Commented May 26, 2017 at 6:25
  • There is no issue with this code. make sure your are using API name of label.
    – Himanshu
    Commented May 26, 2017 at 6:26
  • Please, post your label definition screenshot, together with JS button code
    – kurunve
    Commented May 26, 2017 at 6:27

1 Answer 1

3

Use like this :

alert('{!$Label.Test_CS1}'); 

OR

alert('{!JSENCODE($Label.Test_CS1)}');

The alert must work

Snap shot of alert :

enter image description here

2
  • Hii Partha ,Thank you for the answer .It is working this way Commented May 26, 2017 at 10:23
  • Saswata Das - welcome .. happy to help u :) :) Commented May 26, 2017 at 10:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .