If I have a list of strings like so:
String[] fields = new String[]{'2', '3', '4', '6', '7', '8', '9', '11', '12', '13', '14', '16', '17', '18', '19', '21', '22', '23', '24', '26', '27', '28', '29'};
How can I implement them in a loop to call different field names?
for (String f : fields) {
Lead.Custom_Field_' + f + '__c' = 'whatever';
}
Is this even possible in Apex? Thanks.