Using the all multiselect keyword with the Product2 object.


Question:

I am trying to migrate Product2 records from one sandbox to another using the all multiselect keyword:

SELECT all FROM Product2

However, I am encountering the following error. The field permissions (FLS) appear to be correctly configured:

[12:13:36.877] [ERROR] Error during execution of the command: Recommended_Retail_Price__c, ExternalDataSource.DeveloperName ^ ERROR at Row:1:Column:3200 Didn't understand relationship 'ExternalDataSource' in field path. If you are attempting to use a custom relationship, be sure to append '__r' to the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.. [12:13:36.879] [ERROR] Execution of the command sfdmu:run has been completed. Exit code 4 (COMMAND_EXECUTION_ERROR).

Answer:

To successfully migrate Product2 records using the all multiselect keyword, you need to exclude the ExternalDataSourceId field from the process, like this:

{
    "objects": [
        {
            "query": "SELECT all FROM Product2",
            "operation": "Upsert",
            "externalId": "Name",
            "excludedFields": ["ExternalDataSourceId"]
        }
    ]
}
Last updated on 9th Mar 2025