Skip to content

[BUG] - When using <sObject>.Id as externalId lookup the first match will be skipped #1036

@krasseboehmer

Description

@krasseboehmer

Describe the bug
When using any .Id as lookup for csv files the first match will be skipped. Any record after the first one will be mapped correctly. For the first one an entry within MissingParentRecordsReport.csv will be created, even when the correct related record is queried correctly.

To Reproduce
try to insert any record with an lookup of .Id for example:
AssetWarranty

Asset.PKey__c,StartDate,EndDate,WarrantyTerm.Id
a0b1r00000JPwF3AAL,2017-12-01,2019-12-01,4V39Z00000009XxSAI
a0b1r00000JPwFDAA1,2017-12-01,2019-12-01,4V39Z00000009XxSAI

Expected behavior
The first row gets mapped correctly

export.json

{
    "allOrNone": true,
    "excludeIdsFromCSVFiles": true,
    "objects": [
		{
            "query": "SELECT Id  FROM WarrantyTerm",
            "operation": "Readonly",
            "externalId": "Id",
            "queryAllTarget": true, 
            "master": false
        },{
            "query": "SELECT PKey__c FROM Asset",
			"operation": "Readonly",
            "externalId": "PKey__c",
            "master": false,
        },{
            "query": "SELECT AssetId,StartDate,EndDate,WarrantyTermId FROM AssetWarranty",
            "operation": "Insert",
            "master": true,
            "useValuesMapping": true
        }
    ]
}

_target.csv file.
None, because missing parent record

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions