+ Start a Discussion
ChinnoyChinnoy 

How to write a code for custom setting in apex with out using SOQL query?

How to write a code for custom setting in apex with out using SOQL query?

Thanks in Advance
Best Answer chosen by Chinnoy
Amit Chaudhary 8Amit Chaudhary 8
You can get the custom setting data like below
for (MyLeadToLeadMapping__c mappingTableRec : MyLeadToLeadMapping__c.getall().Values())
             {
                if (mappingTableRec.Name != null && mappingTableRec.Lead_Field_API_Name__c != Null )
                {
                    MapMappingTable.put(mappingTableRec.Name , mappingTableRec.Lead_Field_API_Name__c);
                    
                }
             }

NOTE:- In Above example MyLeadToLeadMapping__c is custom setting
1) http://amitsalesforce.blogspot.com/2014/11/dynamic-field-mapping-using-custom.html

Let us know if this will help you