Hi Folks - as part of our move to Web Client we are dealing with the non operative autoSave() functionality. We will be adding a save and cancel button to all the data change forms.
First off it looked sensible to use the onRecordEditStop to indicate that a record had been edited but there are two challenges with that:
- Just entering a data field starts the onRecordEditStart - and consequently clicking anywhere else runs onRecordEditStop - even when there is no changed data.
- onRecordEditStop is run whenever the user clicks on any element except a data field, so even whilst moving to another tab in the same form to continue editing causes the event to fire.
I guess fixing up 1 is simply a matter of checking for hasRecordChanges and if not do nothing - though that seems inelegant to be honest.
Because our users need to click through several tabs on a form (same record or related data) they would be constantly firing the onRecordEditStop, and for sure we don’t want to keep asking them to save the data they have changed before changing to another tab etc.
So It looks like we need to check for hasRecordChanges whenever the user clicks the forward or back button or on form hide (many forms are deep in tabs so we cant use a global navigation form).
It would seem more logical if onRecordEditStop was actioned when the user attempts to leave the record in some way (move to another form or select a different record), as it is shouldn’t more logically be called onColumnDataEdit or some such. But as it is I don’t think it will work for us.
We will need to do this on dozens of forms and I suspect because of the above we will need to modify the next/previous navigation and the onHide on each of these forms - and since many of them already have these events defined its really hand coding.
Is there a better way to handle this, or perhaps a way to press the onRecordEditStop event into use here without driving the users crazy with warnings to save?
Appreciate feedback on how others handle this.