I am trying to upsert a list of records and have specified external id field as matching field
list<merchandise__c> m = new list<merchandise__c>();
for(integer i = 0;i<2;i++)
{
m.add(new merchandise__c(name='t'+i,price__c=12,description__c='asdf',extid__c='31'));
}
upsert m extid__c ;
Above will give me an error saying,DUPLICATE VALUE .(and yes i do have a record in DB with external id =31)
But strangely it updates that existing record without any exception when i modify the same code below as
list<merchandise__c> m = new list<merchandise__c>();
for(integer i = 0;i<2;i++)
{
m.add(new merchandise__c(name='t'+i,price__c=12,description__c='asdf',extid__c='3'+i));//changed to 3+i
}
upsert m extid__c ;
Why so?