function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jnegijnegi 

System.ListException: Duplicate id in list: with Database.upsert (list,externalid,false)

Hi Devs,

I am receiving "Duplicate id in list" error in the below line and I know "requests" has duplicate ids, isn't it supposed to store success or error in "upserRslt"?

Database.UpsertResult [] upserRslt = Database.upsert(requests, externalIdField, false);

Partial success is not working even with Database.upsert(false) parameter, I am using the above code in the Queueable class, has anyone faced this issue?

Thanks!

 
AbhinavAbhinav (Salesforce Developers) 
Please share relevant code as well.

Check this for reference:

https://salesforce.stackexchange.com/questions/119322/how-to-solve-this-system-listexception-duplicate-id-in-list-in-trigger

Thanks!

 
jnegijnegi
@Abhinav thanks for your response, my query was not to fix duplicate id. My concern was, it should not throw exception when I am using Database.upsert with false parameter.