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
Carsten BONOMOCarsten BONOMO 

Use Custom Label as href

Hello,

I would like to use a custom label to set the value of a href. This is the line of code I want to change :
<a class="primary" href="my_link">Help Centre</a>

I tried <a class="primary" href="{!$label.my_link}">Help Centre</a> to no success.

A lot of thanks for any help,
Carsten
 
Best Answer chosen by Carsten BONOMO
sfdcMonkey.comsfdcMonkey.com
its means you don't have any custom label with name 'VoucherApp_Success_Help_Link'. please double check the spelling

All Answers

sfdcMonkey.comsfdcMonkey.com
try this one :
<apex:outputLink value="{!$label.my_link}">Help Centre</apex:outputLink>
Let us know if it helps you
 
Carsten BONOMOCarsten BONOMO
Hi, thanks for your quick response

I tried your suggestion and got the following : Error: Field $Label.VoucherApp_Success_Help_Link does not exist. Check spelling
Where VoucherApp_Success_Help_Link is the name of my Custom Label.

Thanks a lot
sfdcMonkey.comsfdcMonkey.com
its means you don't have any custom label with name 'VoucherApp_Success_Help_Link'. please double check the spelling
This was selected as the best answer
Carsten BONOMOCarsten BONOMO
<a class="primary" href="{!$label.VoucherApp_Success}">Help Centre</a> worked

I mixed up the description and name of the label. Thank you very much