Hi,
In my understanding, we can set Salutation, FirstName and LastName for the Contact object ; The Name field is automatically updated by concatening these three fields (and this field isn't writable).
So how is this possible :
// TODO #5: Use the Database.insert command to insert the Contacts
// in contacts, with a partial commit.
Database.SaveResult[] sr = Database.insert(contacts, false);
Map <Id, contact> conMap = new Map <Id, Contact>();
for (Contact con : contacts) {
if(con.id!=null) {
// Contact inserted, print id / name
conMap.put(con.id, con);
System.debug('conMap.get(con.id).LastName : ' + conMap.get(con.id).LastName);
System.debug('conMap.get(con.id).NAME (not null ?) : ' + conMap.get(con.id).Name);
}
}
Nb : this is the contact declaration :
Contact name2 = new Contact(LastName='Picasso');
Thanks !