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);
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'}
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 : https://help.salesforce.com/apex/HTViewHelpDoc?id=cs_accessing.htm&language=en (https://help.salesforce.com/apex/HTViewHelpDoc?id=cs_accessing.htm&language=en)
Let me know if you need any further help on this.
Thanks,
Abhishek Bansal.
How to assign the Custom setting values into string
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'}