You need to sign in to do that
Don't have an account?
TheCustomCloud
For Loop question
I am cloning a record and then using a for loop to change say half of the fields on the cloned record. Then I am updating the object. I dont want to write a line for every field I am updating so I wrote a for loop. Unfortunately, its not working.
public void setupMergedAccount(){ mergedAccount = toAccountObj.Clone(); List<String> fieldsToChange = new List<String>{'Phone','BillingCity'}; for(String f : fieldsToChange){ mergedAccount.[f] = fromAccountObj.[f]; // USING THE VARIABLE HERE DOESNT WORK } }
Anyone?
I can suggest:
Cheers,