Understanding the "Record Was Modified" Error
When attempting to save changes to a Salesforce record, you may encounter the error: "This record was modified by [User] during your edit session. Make a note of the data you entered, then reload the record and enter your updates again." This error occurs when Salesforce detects that the record has been modified since you began editing it.
Causes of the "Record Was Modified" Error
-
Multiple Users Editing: Another user modified and saved the record while you were editing it.
-
Lightning Experience Synchronization Issues: When modifying related records, the "Last Modified Date" may update in the database but not refresh on the frontend, causing Salesforce to detect a conflict.
-
Components Triggering Updates: Visualforce pages or components embedded on page layouts that perform DML operations on record load can trigger this error. In Lightning Experience, clicking "Edit" refreshes the page first, which can execute embedded components that update the record just before the edit page appears.
-
Configuration Conflicts: Certain configurations like the "Open Edit Page on Record Creation" option in some managed packages are not compatible with Lightning Experience and can trigger this error.
How to Handle the "Record Was Modified" Error
-
Reload and Re-edit: Follow the error message instructions - note your changes, reload the record, and apply your changes again.
-
Identify and Remove Problematic Components: If you consistently experience this error, check for Visualforce pages or other components on your page layouts that might be performing DML operations on the same record. These components might need to be modified or removed.
-
Review Configuration Settings: If using managed packages, check if options like "Open Edit Page on Record Creation" are enabled. Disabling such options can prevent the error from appearing.
-
Switch to Classic (Temporary Workaround): Some users report that the error only occurs in Lightning Experience. If critical, temporarily switch to Salesforce Classic to make your changes.
Conclusion
The "Record was modified" error is often a result of Lightning Experience's architecture or component interactions rather than actual data collisions. While the immediate solution is to reload and re-enter data, addressing the underlying causes by modifying page layouts or configurations will provide a permanent fix. When experiencing persistent issues, contact Salesforce Support for assistance.