You need to sign in to do that
Don't have an account?
Need to use custom settings in Apex replacing hard coded values
Hi All,
I'm need to use custom settings in my apex code.
Custom setting- Quote_Status__c
Field- Status__c
values:Approved ,In Progress and Rejected.
Please help me in writing if condintion..Below I did hard codeing need to use custome settings there ..
if(quote.recordTypeId==something && (quote.Status=='In Progress'||quote.Status=='Approved'||quote.Status=='Rejected & ')){ //code }
String quoteStatus = quote.Status;
if(quote.recordTypeId==something){
// check quote.status value in custom setting
for (Quote_Status__c customSetting : Quote_Status__c.getAll().values()) {
if (customSetting.Status__c.contains(quoteStatus)) {
// do your business
}
}// end for
}// end if
Please mark it best if it helps you. Thanks in advance.
Regards,
Pawan Kumar