VariableResolver vr = fc.getApplication().getVariableResolver();
DcReferences references = (DcReferences) vr.resolveVariable(fc, "references");
String[] keys = references.getKeys();
DcWebObject wod = getParentObject();
DcObject dco = wod.getDcObject();
dco.setValue(references.getFieldIdx(), null);
int referenceModIdx = dco.getField(references.getFieldIdx()).getReferenceIdx();
for (String key : keys) {
DcObject reference = DataManager.getItem(referenceModIdx, key);
DataManager.createReference(dco, references.getFieldIdx(), reference);
}
try {
dco.saveUpdate(false);
} catch (ValidationException ve) {
ve.printStackTrace();
}
wod.load();
return back();
}