I need help to do a DML operation with external id field. I am using the below syntax, but it is throwing an error

Schema.SObjectField f = PricebookEntry.Fields.Product_Code__c;
Database.UpsertResult[] myResult = Database.upsert(insertList,f,false);

Error: getErrors=(Database.Error[getFields=();getMessage=Product_Code__c not specified;getStatusCode=MISSING_ARGUMENT;]);getId=null

Any help here is greatly appreciated. Thanks.

  • 2
    It reads like you have one or more records that do not have a Product_Code__c field specified, hence the error. Make sure your data is correct.
    – sfdcfox
    Jun 11, 2020 at 12:47
  • Thanks, sfdcfox!
    – jsmith
    Jun 11, 2020 at 13:07


You must log in to answer this question.

Browse other questions tagged .