How does upsert work in the Salesforce API?
I believe that it checks it checks if there is a record with a unique id. In the case that it is available, then it updates the record otherwise the record is created.
Is this correct?
I am receiving the following error
Upsert failed. First exception on row 1; first error: DUPLICATE_EXTERNAL_ID, Asset Tag: more than one record found for external id field: [a11M0000000CwJqIAK, a11M0000000CwJvIAK]: [Asset_Tag__c]
I have a list with items, and there are no duplicate Asset_Tag values.
system.debug('LstItem Asset_Tag__c'+LstItem );
upsert LstItem Asset_Tag__c;
From the debug log
LstItem Asset_Tag__c(Item_c__c:{Scanned_By__c=005M0000000IlxyIAC, Asset_Tag__c=12149, Status__c=Active, Scan_Location__c=001M0000008GzJXIA0, Last_Scan_Date__c=2011-12-17 06:08:47}, Item_c__c:{Scanned_By__c=005M0000000IlxyIAC, Asset_Tag__c=23157, Status__c=Active, Scan_Location__c=001M0000008GzJXIA0, Last_Scan_Date__c=2011-12-17 08:26:14})
What can I do to resolve this issue?