You need to sign in to do that
Don't have an account?
Yogesh Biyani
System.DmlException: Upsert failed. First exception on row 135; first error: DUPLICATES_DETECTED, You have an existing Account:
I am getting this error when I am during account upsert. What does the row number in this error message mean?
You can avoid that duplicacy by using set and before upsert clone back those records to list.
let me know if additional query
May be you are trying to upsert list of records, containing same id values e.g. you can see in below code i have two records in list that is going to be upsert, having same id value.
List<Account> liAcc = new List<Account>();
Account acc1 = new Account();
acc1.Name = 'Acc1';
insert acc1;
liAcc.add(acc1);
Account acc2 = new Account();
acc2.id = acc1.id;
acc2.Name = 'ABC123';
liAcc.add(acc2);
upsert liAcc;
Regards,
Deepak
Thanks for your comments. After using the Set this issue was resolved.
Regards,
Yogesh
Please mark previous replied answer as the soultion so that your question will be automatically marked solved and it could be helpful for other members as well !
Happy Coding :)