diff --git a/src/main/java/com/salesforce/dataloader/client/PartnerClient.java b/src/main/java/com/salesforce/dataloader/client/PartnerClient.java index aeeeee6b..07a1b006 100644 --- a/src/main/java/com/salesforce/dataloader/client/PartnerClient.java +++ b/src/main/java/com/salesforce/dataloader/client/PartnerClient.java @@ -810,7 +810,7 @@ public void setFieldReferenceDescribes() throws ConnectionException { // make sure that the object is legal to upsert Field[] parentObjectFields = describeSObject(parentObjectName).getFields(); - Map parentFieldInfo = new HashMap(); + Map parentIdLookupFieldMap = new HashMap(); for (Field parentField : parentObjectFields) { if (!parentField.isIdLookup()) { continue; @@ -833,12 +833,14 @@ public void setFieldReferenceDescribes() throws ConnectionException { childObjectField.setLabel(childFieldLabel); } else { // non-Id lookup field on the parent entity if (haSingleParentObject) { - parentFieldInfo.put(parentField.getName(), parentField); + parentIdLookupFieldMap.put(parentField.getName(), parentField); } } } // for loop - if (!parentFieldInfo.isEmpty()) { - DescribeRefObject describeRelationship = new DescribeRefObject(parentObjectName, childObjectField, parentFieldInfo); + if (!parentIdLookupFieldMap.isEmpty()) { + // A non-empty parentIdLookupFieldMap implies non-polymorphic lookup relationship + // to a parent object that has idLookup fields. + DescribeRefObject describeRelationship = new DescribeRefObject(parentObjectName, childObjectField, parentIdLookupFieldMap); referenceDescribes.put(relationshipName, describeRelationship); } }