You need to sign in to do that
Don't have an account?
Muna Jamous 8
Allow multiple update of an SF ID in a list using Database.update
I am trying to update the same id in a list mutliple times, is there a way to do that
List<contact> ConList = new List<contact>(); contact pe = new contact(); pe.id = '0032900000QsV17'; pe.phone__c= false; ConList .add(pe); contact pe2 = new contact (); pe2.id = '0032900000QsV17'; pe2.phone__c= true; ConList .add(pe2); Database.SaveResult[] srList = Database.update(ConList ,false); System.debug('srList===' + srList);
If this solves your issue please mark this answer as correct, it may help others
You can not update the same id in the list multiple times because it gives you the error but there is a way to solve this issue. Instead of creating the different instances of the record update the same instance of the record.
If this solves your issue please mark this answer as correct.
Thanks,
Kirti Rathod