+ Start a Discussion

upsert sets Last Modified fields even if nothing changed?

I think I'm seeing behavior where the system sets the Last Modified fields of a group of records when I do an upsert, even when I have only modified some of the records.


I'm using a SOQL statement to load an array of records.  I go through that array and make changes to some of the records.  I then upsert the array.  I'm seeing all of the records get their modified date/user set in that process.


Am I supposed to create another list of modified records, and only do the upsert on them?


Yes, I think that is how it behaves. Ditto when you go to some record's edit page, make a blank update (hit update without actually changing anything) and it still updates the last modified date.