Concurrent Editing

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
srufini
Posts: 33
Joined: Thu May 23, 2019 11:23 pm

Concurrent Editing

Post by srufini »

Hello everyone,

I am trying to find the best approach to avoid conflict in editing BOs.
Until now I used for many BO the option "auto-save". I find it useful especially for text field with a long text (minutes of meeting, reports, etc..).
The problem is that in the scenario where two users are opening it and editing, the one that edit later will be propted that the BO has been changes ant therefore cannot be changes, and since is in auto-saving cannot close anymore the BO form unless refresh the whole app. either case he will lose his editing.

In my view, as different approach, I would like to implement a edit button on top of the form, in order to:
- when you open the BO is always in view mode only
- if you click EDIT button then the fields are editable (possibly also with auto-save, but not always)
- if another user has clicked the EDIT button then the edit button is not active for other users
- once the first user save the edit button is available to other (but also the form shall be refreshed)
- finally in case of interruption from the first user, the edito button shall be left unlock after a certain period of time

in order to do that, I would need at least some kind a context general information that someoneelse has opened the BO. Does this information exsists?
or can you reccomend different approaches?

Thanks

Sergio
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Concurrent Editing

Post by aware_support »

This can be achieved with some Javascripting:

1) Your BO will need a special attribute (Yes/No) to indicate that the BO has been locked by some user
2) You will need a special Javascript that will check the value of this attribute and enable/disable the EDIT button
3) You will need another Javascript to set this flag to Yes on the server as soon as the first user clicks on the EDIT button

However, this scenario will still not work if 2 users opened the form while it was not locked and then one of the users locks the record. The second user will still have his button enabled after the record was locked by the first user. The only solution to that is to have yet another script that will periodically ask the server if the record is still unlocked or not.
Aware IM Support Team
srufini
Posts: 33
Joined: Thu May 23, 2019 11:23 pm

Re: Concurrent Editing

Post by srufini »

Thanks!
Post Reply