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
bhanu_prakashbhanu_prakash 

Fetch list of custom settings need to display in Vfpage

Hi,

Iam looking to fetch all list of custom settings and need to display in Vfpage 
i have verifed and found that we can call one custom settings and refer in vf page 
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_custommetadatatype__mdt.htm
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_custom_settings.htm#apex_methods_system_custom_settings

But I need to fetch list of custom setttings .. How can i acheive it ?

 
Om PrakashOm Prakash
Hi Bhanu,
You need to use Schema.getGlobalDescribe then ceck if customSetting.
Bellow is code sample.
List<String> lstCustomSettings = new List<String>();
Map<String, Schema.SObjectType> mapObj = Schema.getGlobalDescribe();
for(String objName : mapObj.keyset()){
	if(mapObj.get(objName).getDescribe().isCustomSetting()){
		 lstCustomSettings.add(objName);
		 // If you need label of Custom setting then mapObj.get(objName).getDescribe().getlabel()
	}
}

Let me know if any query
MagulanDuraipandianMagulanDuraipandian
Check the below link for example

http://www.infallibletechie.com/2013/04/how-to-display-custom-setting-data.html