Invalid field for upsert
Detection
- RegExp:
Error (.*) Invalid field for upsert, must be an External Id custom or standard indexed field: (.*) \((.*)\)
Examples
Error Account_Import Invalid field for upsert, must be an External Id custom or standard indexed field: Code__c (12:34)
Resolution
{1} uses field {2} for an upsert, but it is not an External Id in the target org.
- Check that {2} is declared as externalId in its field file
- With delta deployments, an item that did not change in the Pull Request is not deployed: change it in the Pull Request, or turn on useDeltaDeploymentWithDependencies (https://sfdx-hardis.cloudity.com/salesforce-devops-config-delta-deployment/)
- If it is declared as externalId and deployed, set it manually as External Id in the target org