Skip to content

Commit

Permalink
more comments and better naming for code readability
Browse files Browse the repository at this point in the history
more comments and better naming for code readability
  • Loading branch information
ashitsalesforce committed Oct 21, 2023
1 parent 5ff702e commit 929b089
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ public void setFieldReferenceDescribes() throws ConnectionException {

// make sure that the object is legal to upsert
Field[] parentObjectFields = describeSObject(parentObjectName).getFields();
Map<String, Field> parentFieldInfo = new HashMap<String, Field>();
Map<String, Field> parentIdLookupFieldMap = new HashMap<String, Field>();
for (Field parentField : parentObjectFields) {
if (!parentField.isIdLookup()) {
continue;
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 929b089

Please sign in to comment.