<@U3T4J28HG> well first of all I should explain wh...
# suitescript
j
@lleclerc well first of all I should explain what I’ve got working so far (note that I’ve designed this solution to be fairly generic but I’m only using it for now on certain transation records). I’ve made a custom record type “Record Edit Audit” to store records currently being edited (record type, record id, user, time). When someone goes to try to edit, on PageInit in the custom form for that transaction, it checks if someone else is already editing (see if there is an entry for this record in Record Edit Audit). If so, it shows a warning to the user. If not (e.g. this is the only person trying to edit right now), a new Record Edit Audit record is created. The ID of this Record Edit Audit is put in a hidden field on the transaction, (not set to “store value”, we don’t need to keep it permanently). The only purpose of this field is to be able to track which Record Edit Audit is the “live person editing this record”. Then when the user leaves the page (close window, to different URL, whatever), on page unload, it checks the hidden field, and calls a function to deactivate the corresponding Record Edit Audit (basically saying “this person is done editing, it’s ok for someone else to go now”). This all works great EXCEPT in the case where the “first” user doesn’t actually do anything to leave the page, but they have, in essence, left the page because their session ended. If this happens, I need a way to again check that hidden field and deactivate the corresponding Record Edit Audit.