Is it possible to reference the fields of an sObject (opportunity in this example) dynamically from a string value?
For example, take the following code:
for(Opportunity o: oppList) {
for(String s : strList) {
// I'd like to set the opportunity field values based on the string
// value that contains the API name of the opportunity field
}
}
So, the variable strList
contains the opportunity API field names. I'm trying to clear some fields on the opportunity in a before update trigger, but I have to access the field names dynamically in the strList
.