I have created a Custom Settings ‘
Tal_Source_Map__c
‘ which has 4 fields.
- SF_Source_Type__c
- SF_Source_Sub_Type__c
- Tal_Source_Type__c
- Tal_Source_Type__c
Combination of
SF_Source_Type__c
andSF_Source_Sub_Type__c
will have a unique set ofTal_Source_Type__c
andTal_Source_Type__c
.How can I get
Tal_Source_Type__c
andTal_Source_Type__c
values usingSF_Source_Type__c
andSF_Source_Sub_Type__c
?Is it possible to use getInstance()?
Answer
You can use SOQL to query Custom Settings just like an object. Use a SQOL query to find the right value:
select Tal_Source_Type__c, Tal_Source_Type__c from Tal_Sourc_Map__c
where SF_Source_Type__c = :someval and SF_Source_Sub_Type__c = :otherval
Attribution
Source : Link , Question Author : Yash Mehta , Answer Author : Daniel Hoechst