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
RArunrajRArunraj 

Custom settings value in visualforce page without controller

Hi,

 

can any body help me on the custom settings

 

I am having a List Custom Settings, in that i am using the name field for storing some values like A, B, C

 

I need to display these values using visualforce pages, But I am able to do that with the help of controller as shown below 

 

public class HierarchyController {     

       public List<samplelist__c> getSampleList(){      

             List<samplelist__c> allSampleList = samplelist__c.getall().values();                

             return allSampleList;    

       }

}

 

But without using controller, is it possible to get that custom setting list, of all values directly in the Visualforce page? 

 

Thanks,

Arunraj

Best Answer chosen by Admin (Salesforce Developers) 
kiranmutturukiranmutturu

u can do like this

 

 

<apex:page standardController="CSO__c" recordSetVar="CSObj"> <apex:pageBlock> <apex:pageBlockTable value="{!CSObj}" var="a"> <apex:column value="{!a.yes__c}"/> </apex:pageBlockTable> </apex:pageBlock> 

 

CSO__c is my customsetting object with list type and yes__c is my check box field.. try this...

All Answers

Chamil MadusankaChamil Madusanka

Hi,

 

According to my knowledge it cannot be used without controller

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

Shashikant SharmaShashikant Sharma

Try this

 

{!$Setup.CustomSettingName__c.FieldName__c} 

 

This will work for setting type : Hierarchy

kiranmutturukiranmutturu

u can do like this

 

 

<apex:page standardController="CSO__c" recordSetVar="CSObj"> <apex:pageBlock> <apex:pageBlockTable value="{!CSObj}" var="a"> <apex:column value="{!a.yes__c}"/> </apex:pageBlockTable> </apex:pageBlock> 

 

CSO__c is my customsetting object with list type and yes__c is my check box field.. try this...

This was selected as the best answer
Muhammad Yusuf 8Muhammad Yusuf 8
For Setting type = Hierarchy, you do not need to go to apex you can directly get it in VF 
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_setup.htm