I will create a support ticket with MS
Copy Activity to Salesforce Sink failure when updating a field referenced through a lookup relationship
Hello All,
I have a Copy Activity defined whose source is a CSV and target is a custom Salesforce sObject.
As part of the mapping, I need to update a custom field on the standard Account sObject, which is referenced by the custom sObject through a lookup relationship field.
The Relevant Schemas for the two sObjects are: sinkCustomSalesforceObj.Lookup_Relationship_to_Account__r, Account.ID_In_Account__c
My first thought is to reference the field through the lookup relation field:
{
"inputs": [
{
"referenceName": "sourceCSV",
"type": "DatasetReference"
}
],
"outputs": [
{
"referenceName": "sinkCustomSalesforceObj",
"type": "DatasetReference"
}
],
"typeProperties": {
"source": {
"type": "DelimitedTextSource",
"storeSettings": {
"type": "SftpReadSettings",
"recursive": true,
"enablePartitionDiscovery": false,
"disableChunking": false
},
"formatSettings": {
"type": "DelimitedTextReadSettings"
}
},
"sink": {
"type": "SalesforceSink",
"writeBatchSize": 5000,
"writeBehavior": "upsert",
"externalIdFieldName": "external_Id__c", //i.e. sinkCustomSalesforceObj.external_Id__c
"ignoreNullValues": false
},
"enableStaging": false,
"translator": {
"type": "TabularTranslator",
"mappings": [
...,
{
"source": {
"name": "ColumnFromCSV"
},
"sink": {
"name": "Look_Up__r.ID_In_Account__c"
}
}
],
"typeConversion": true,
"typeConversionSettings": {
"allowDataTruncation": true,
"treatBooleanAsNumber": false
}
}
}
}
However, this results in the following error:
ErrorCode=SalesforceOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Salesforce Operation Failed: INVALID_FIELD:Foreign key external ID: 12345678 not found for field ID_In_Account__c in entity Account:--,Source=Microsoft.DataTransfer.Runtime.SalesforceConnector,'
The Salesforce specific docs doe not mention how to deal with this issue.
Does anyone have any suggestions?
Regards