From 6604d582dcf7e1cfb7debad0a453685912478668 Mon Sep 17 00:00:00 2001 From: ashitsalesforce Date: Sat, 10 Feb 2024 23:48:08 -0800 Subject: [PATCH] UI label changes for relationship mapping step UI label changes for relationship mapping step --- .../ui/ChooseLookupFieldForRelationshipPage.java | 9 +++++---- .../dataloader/ui/mapping/SforceLabelProvider.java | 5 +++-- src/main/resources/labels.properties | 10 +++++----- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/salesforce/dataloader/ui/ChooseLookupFieldForRelationshipPage.java b/src/main/java/com/salesforce/dataloader/ui/ChooseLookupFieldForRelationshipPage.java index 607f3ecd..d3f9bc22 100644 --- a/src/main/java/com/salesforce/dataloader/ui/ChooseLookupFieldForRelationshipPage.java +++ b/src/main/java/com/salesforce/dataloader/ui/ChooseLookupFieldForRelationshipPage.java @@ -232,9 +232,9 @@ private void populateParentLookupFieldCombo(Combo extIdCombo, RelationshipField // set the objects reference information List fieldList = new ArrayList(extIdInfo.getParentObjectFieldMap().keySet()); // add default selection "not selected" to the list to allow users to go back to it - fieldList.add(Labels.getString( - Labels.getString(getClass().getSimpleName() + ".defaultComboText"))); - UIUtils.setComboItems(extIdCombo, fieldList, Labels.getString("ForeignKeyExternalIdPage.defaultComboText")); + String defaultListItemStr = Labels.getString(getClass().getSimpleName() + ".defaultComboText"); + fieldList.add(defaultListItemStr); + UIUtils.setComboItems(extIdCombo, fieldList, defaultListItemStr); } /** @@ -266,7 +266,8 @@ private Map saveExtIdData() { String lookupFieldInParent = combo.getText(); RelationshipField relationshipField = getSelectedParentSObjectForLookupField(relationshipNameInCombo, lookupFieldInParent); // make sure that the item selection has occurred and that the default text is not displayed anymore - if(relationshipField != null) { + if(relationshipField != null + && !relationshipField.getParentFieldName().equalsIgnoreCase(Labels.getString(getClass().getSimpleName() + ".defaultComboText"))) { DescribeRefObject refDescribe = referenceObjects.getParentSObject(relationshipField.toFormattedRelationshipString()); Field relatedField = new Field(); Field parentField = refDescribe.getParentObjectFieldMap().get(lookupFieldInParent); diff --git a/src/main/java/com/salesforce/dataloader/ui/mapping/SforceLabelProvider.java b/src/main/java/com/salesforce/dataloader/ui/mapping/SforceLabelProvider.java index 89df6890..3b20c46f 100644 --- a/src/main/java/com/salesforce/dataloader/ui/mapping/SforceLabelProvider.java +++ b/src/main/java/com/salesforce/dataloader/ui/mapping/SforceLabelProvider.java @@ -32,6 +32,7 @@ import com.salesforce.dataloader.client.DescribeRefObject; import com.salesforce.dataloader.controller.Controller; +import com.salesforce.dataloader.dyna.RelationshipField; import com.salesforce.dataloader.ui.MappingDialog; import com.sforce.soap.partner.Field; @@ -73,8 +74,8 @@ public String getColumnText(Object arg0, int arg1) { switch (arg1) { case MappingDialog.FIELD_NAME: text = field.getName(); - if (isReferenceField && !text.contains(":")) { - text = text + ":Id"; + if (isReferenceField && !text.contains(RelationshipField.NEW_FORMAT_PARENT_IDLOOKUP_FIELD_SEPARATOR_CHAR)) { + text = field.getRelationshipName() + RelationshipField.NEW_FORMAT_PARENT_IDLOOKUP_FIELD_SEPARATOR_CHAR + "Id"; } break; case MappingDialog.FIELD_LABEL: diff --git a/src/main/resources/labels.properties b/src/main/resources/labels.properties index 9812c0f5..aad2bc25 100644 --- a/src/main/resources/labels.properties +++ b/src/main/resources/labels.properties @@ -157,9 +157,9 @@ MappingDialog.dragFields=Drag the Salesforce object fields down to the column ma MappingDialog.saveMapping=Save Mapping MappingDialog.errorSave=Error while saving mapping MappingDialog.fileColumn=CSV Column Header -MappingDialog.sforceFieldName=Field Name:Lookup Field Name -MappingDialog.sforceFieldLabel=Field Label (Lookup Field Label) -MappingDialog.sforceFieldType=Data Type (Lookup Object) +MappingDialog.sforceFieldName=Field Name/Relationship +MappingDialog.sforceFieldLabel=Field Label +MappingDialog.sforceFieldType=Field Data Type OAuthInBrowser.title=Login from Browser OAuthInBrowser.authStep1Title=Step 1: @@ -259,13 +259,13 @@ FinishPage.overwritten= FinishPage.output=Output FinishPage.chooseDir=Folder: -ChooseLookupFieldForRelationshipPage.title=Step 2b: (Optional) Use lookup fields of related objects for relationships +ChooseLookupFieldForRelationshipPage.title=Step 2b: (Optional) relate using lookup field ChooseLookupFieldForRelationshipPage.description=For each related object, select a lookup fields of related objects for relationship fields. Otherwise, leave the selection blank. ChooseLookupFieldForRelationshipPage.defaultComboText= ChooseLookupFieldForRelationshipPage.pageMessage=Relationships of {0} are listed below.\nSelect a related object and its lookup field if the CSV refers to the related object using the selected lookup field. ChooseLookupFieldForRelationshipPage.relationshipHeader=Relationship ChooseLookupFieldForRelationshipPage.parentObjectHeader=Related Object -ChooseLookupFieldForRelationshipPage.parentLookupFieldHeader=Lookup Field +ChooseLookupFieldForRelationshipPage.parentLookupFieldHeader=Lookup Field of Related Object HardDeleteFinishPage.title=Step 4: Finish HardDeleteFinishPage.description=Select the folder where your success and error files will be saved.