Undoing edit changes
I use an "edit record" layout. When the user is finished editing, I prompt for save, undo or more modifications (continue editing).
If edit completion is intercepted via the script trigger "layout exit", the record has been committed by this point. An undo would require that I save each field prior to changes and restore the saved record since a revert does not undo committed records.
If edit completion is intercepted via the script trigger "on record commit" then all is ok, except if the user clicks outside of a layout data entry panel which commits the record up to that point which means that if an undo is selected only changes made after the "outside" click will be reverted.
I realize that "outside" clicks are likely to be rare, but not impossible and this could lead to problems. If I use the trigger "on record commit", the user will have the option to go back and make more mods if s/he clicks outside of a data entry panel. Of course, getting the save/undo/continue prompt in the first place from an outside the box click will be confusing to someone entering data.
Is there a way to prevent OOTB clicks causing commits, or is the best bet to save the entire record and restore it on an undo and use the trigger "on layout edit" which will not lead to unwanted panel pop ups.
Opinions, ideas, facts appreciated.