function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
tomcollinstomcollins 

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?

vishal@forcevishal@force

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.