I was created a home page component and its type is link. Also created a custom link . I want to access one of the field of custom setting in my custom link is it possible..? My custom link Behavior is "Execute Javascript" or Content Source is "onClick JavaScript".

2 Answers 2


See the Accessing Custom Settings

Formula Fields:

Formula fields only work for hierarchy custom settings; they can’t be used for list custom settings.


Below code works only when, you are using hierarchy custom settings.

var customSetInstance = '{!$Setup.lightening16__TestHSetting__c.lightening16__TestName__c}';
  • When i save my custom link after adding your code getting error : An internal server error has occurred An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Error ID: 1954184272-437363 (-1712020808) Aug 3, 2016 at 12:44
  • Hello Dev, my custom setting is list type. Aug 3, 2016 at 12:45
  • You are getting an error because list type custom setting is not supported there.
    – Devendra
    Aug 3, 2016 at 12:58
  • Is there any way to get list type custom setting value in custom link Aug 3, 2016 at 13:11
  • One way could be call apex method from there and retrieve a Custom Setting Value. I haven't tried this. Need to try. developer.salesforce.com/docs/atlas.en-us.apexcode.meta/…
    – Devendra
    Aug 3, 2016 at 13:22

There is a similar question, here in this post is the answer to retrieve a hierarchy custom setting data: How to Access a Hierarchy Custom Setting from Lightning Component.

Working with list custom setting should be the same.

Basically you have to call the controller and return that custom setting info, then you can save that info to an aura attribute to use it later.

UPDATE: Using custom setting data in visualforce components.

Component or visualforce page:

<apex:page controller="testCont">
    <apex:repeat value="{!ListSettings2}" var="settings">

Controller side:

public class testCont {
    public MyHiearchy__c getHiearchySettings(){
        return MyHiearchy__c.getInstance();

    public MyList__c getListSettings1(){
        return MyList__c.getValues(data_set_name);

    public List<MyList__c> getListSettings2(){
        return MyList__c.getAll().values();
  • Hello Cruz i am not using lightning component. This is standard home page component. Aug 3, 2016 at 12:27
  • In that case use Devendra solution, also I will update my solution with an example of how to retrieve the custom setting from controller and assign it to a controller variable to use it later in your component.
    – D. Cruz
    Aug 3, 2016 at 12:41

You must log in to answer this question.

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