New answers tagged

1

You'll want to use the put() method for this. for(Schema.FieldSetMember field : SObjectType.Account.FieldSets.AccountFieldSet.getFields()) { String fieldName = field.getName(); targetRecord.put(fieldName, sourceRecord.get(fieldName); } Information regarding the put() and get() methods as they pertain to SObjects can be found here.


Top 50 recent answers are included