You need to sign in to do that
Don't have an account?
help with Apex Conditional IF statement to auto-populate field values.
Hello,
I have the following conditional statement and it is not autopopulating the State field values that I need. What am I doing wrong?
Your help is greatly appreciated!
-- (NOTE: California = 127; Colorado = 128, Texas = 209) --
Snippet:
if(selectedQuote.get(0).State__c == 'California'){
string stateId = '127';
if(selectedQuote.get(0).State__c == 'Colorado'){
stateId = '128';
} else (selectedQuote.get(0).State__c == 'Texas'){
stateId = '209';
}
hope+='<FieldWithValue>'+
+'<FieldId xmlns="http://filehold.com/librarymanager/scanningmanager/">54</FieldId>'+
+'<FieldValue xsi:type="ArrayOfInt" xmlns="http://filehold.com/librarymanager/scanningmanager/"><int xmlns="">'+stateId+'</int></FieldValue>'+
+'</FieldWithValue>';
}
try withbelow code.
If this helps, Please mark it as best answer.
Thanks!!
Hi Ankaiah,
Unfortunately, that did not work. Below is the full Apex Class.
(Note: the code requires specific Metadata Values be set up under our Custom Settings, which have been added)
I have obfuscated the authentication details.