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
Kota Uday 6Kota Uday 6 

custom setting object url field as hyperlink in vf page

Hi ,
I have created a custom setting object with URL field and saved the url in that,Now I want to use that url as a hyperlink in my vf page ,
Can any one help m wtih syntax .
My syntax :
<a href="{!PartnerCommunityURL__c.getInstance().URL__c}" class="btn btn-sm btn-success btn-block"><i class="fa fa-key fa-fw"></i> LogIn</a>

Please help me
Best Answer chosen by Kota Uday 6
Kota Uday 6Kota Uday 6
Hi All,
For this I have created Custom Lable and its working fine now,
{!$Label.LabelName}

All Answers

Nayana KNayana K
I assume you are trying to refer hierarchy custom setting.
<a href="{!$Setup.PartnerCommunityURL__c.URL__c}" class="btn btn-sm btn-success btn-block"><i class="fa fa-key fa-fw"></i> LogIn</a>

NOTE: Only 'hierarchy' custom setting can be directly referred in VF. We can't directly use list custom setting in VF.
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_setup.htm
 
Kota Uday 6Kota Uday 6
Hi Nayana,

Thanks for your reply but its showing error  "}" missing , I have tried before also .
 
Kota Uday 6Kota Uday 6
Hi All,
For this I have created Custom Lable and its working fine now,
{!$Label.LabelName}
This was selected as the best answer