+ Start a Discussion
Aryan JhaAryan Jha 

I Have a List where two contact is being inserted and i have to update after inserting list how can i add feilds and then update it

List<Contact> conList = new List<Contact>{
    new Contact(FirstName='aryan',LastName='jha',description='computer'),
        new Contact(FirstName='atul',LastName='kumar',description='Buisness')};                                };
system.debug(+ conList );
insert conList;
List<Contact>Listtoupdate=new List<Contact>();
for(Contact con: conList){
con.Title='i am a computer analyst';
system.debug(+ Listtoupdate );
update conList;
Nick S.Nick S.
Hi Aryan - your listToUpdate is created with no records and never gets any records added to it.  The original conList is the one that is edited.  Is that the intent?