• History class does not capture changes when doc saved multiple times

    By Slawek Rogulski 2 decades ago

    I am not sure if this is the intended behaviour. When a document is saved multiple times with different values in the tracked fields for each save only the first field value change is recorded. The array holding the initial field values is not refreshed post save to record the now initial values. Again, perhaps this is intentional.

    • It's intentional, but could be problematic

      By Kevin Pettitt 2 decades ago

      I believe the original idea was that while a document is open, it may be saved using Ctrl-S or some other method that doesn't involve closing the document (or even taking it out of edit mode). Counting this editing session as a single event, you don't necessarily want to know that the user changed a particular value 3 times before setting on the right one, thus the original value array only resets after the document is closed and reopened.



      I could see this being a problem if:



      1) Users make a habit of leaving a document open for hours/days at a time, making numerous edits that are never recorded but which may be referenced by other people or processes during that time.

      2) The developer creates a "Save" button that simply switches from edit to read mode, allowing users to leave a document open for long periods even more easily.



      So my question to you and anyone else is how would you like it to work? Should the "initial values" recompute for EVERY save, or just ones more than 5/10/15/n minutes after the previous one? Should this behavior be configurable at the database/form config level?



      Keep in mind that my plan is eventually to merge this functionality with the activity tracking functions, at least in terms of the code being part of a single set of class(es)/functions. The outputs between the two functions might or might not continue to be distinct insofar as an edit record might include the corresponding change history, or it might be separate. I'd be interested in thoughts on that as well, and you can put ideas relating to that in the Requests section.