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
raz rraz r 

how to pull the custom setting records in to string

how to pull the custom setting records in to string 
Abhishek BansalAbhishek Bansal
HI Raz,

Please use the below syntax to get custom setting records in apex class :
For List custom setting :
1. Map<String_dataset_name, CustomSettingName__c> mcs = CustomSettingName__c.getAll(); OR
2. CustomSettingName__c mc = CustomSettingName__c.getValues(data_set_name);

For Hierarchy Custom Settings :
1. CustomSettingName__c mc = CustomSettingName__c.getOrgDefaults();
2. CustomSettingName__c mc = CustomSettingName__c.getInstance(Profile_ID);

Please find more help on this link : (

Let me know if you need any further help on this.

Abhishek Bansal.
raz rraz r
Hi Abhishek,

How to assign the Custom setting values into string
raz rraz r
please give me some example..thanks in advance
Class slaesforceClass slaesforce
u assain values collection in(map)
 in using collection of map string values first single codcation (exa:- 'raz') in salesforce..... only
second one collection using map <string to string> comparision.....f(first string is "value "second string is "key"
like this way
this is syntax::---- 
Map<string,string> razr(u r assign name) = new Map<string,string>

third one using string in collection in (map)
map<string,string> razr = new map<string,string>{'living'=>'bangalore', 'staying'=>' cross road'}