*/
private void updateSforce() {
ArrayList<Field> mappableFieldList = new ArrayList<Field>();
ArrayList<Field> allFieldList = new ArrayList<Field>();
Field field;
OperationInfo operation = controller.getConfig().getOperationInfo();
for (int i = 0; i < sforceFieldInfo.length; i++) {
field = sforceFieldInfo[i];
boolean isMappable = false;
switch (operation) {
case insert:
if (field.isCreateable()) {
isMappable = true;
}
break;
case delete:
case hard_delete:
if (field.getType().toString().toLowerCase().equals("id")) {
isMappable = true;
}
break;
case upsert:
if (field.isUpdateable() || field.isCreateable()
|| field.getType().toString().toLowerCase().equals("id")) {
isMappable = true;
}
break;
case update:
if (field.isUpdateable() || field.getType().toString().toLowerCase().equals("id")) {
isMappable = true;
}
break;
default:
throw new UnsupportedOperationException();
}
// only add the field to mappings if it's not already used in mapping
if(isMappable) {
if(!mappedFields.contains(field.getName())) {
mappableFieldList.add(field);
}
// this list is for all fields in case map is reset
allFieldList.add(field);
}