Record Locking Grid Records



Legendary Poster
Hi list,

I want to lock selected grid records in a Find Browse (that has Row Exits to perform DB actions on the GC records) and stop other users accessing them at the same time.

The users never leave the FB form. Except to click Close/Cancel. A UBE linked to a Row Exit is fired off asynchronously.
I had planned to remove the lock in the End of the UBE

Now I know all about F00095, N0000602 Reserve Object/Remove Reservation etc, and all that's fine and dandy but I've never tried this on selected grid records before, just FI forms etc.

The event I'll use to fire off the lock is Row is Selected
I'll remove the lock in a UBE that processes the record or in Row is Unselected.

Is there anywhere else I need to do this? Cancel Button? Loop through selected rows etc. Or does the cancel button automatically call the Grid is Unselected?

Has anyone else here done this? Any help would be cool and most welcome.


Last edited:
I would think, since the UBE is asynchronous the removal of the lock must be done in the UBE. The user could kick off a UBE and hit close/cancel right away. You wouldn't want that to remove the reservation while the UBE is running.

Also, do you really want to kick this off when selecting the row, not a row exit? I would be concerned about firing the UBE all over the place.

Cheers Craig.

I set the lock when they highlight the row, I only launch the UBE when they click the Row Exit (I'm just trying to stop 2 people doing it at the same time)

As for where to remove the lock, I will do it in the UBE yes, but I was thinking if the user cancels their selection, where inside the APPL do I need to remove the locks that were created when the user selected the row.

I know what you mean about firing off the UBE, but believe me it's better than what they have at the moment :) All the ER logic is inside a Row Exit and it times out!
So I'm just moving the logic to the UBE
If its specific document or less nos. of record i would lock all instead of selected rows?. This would make logic simple unless there is specific need that to go for individual records.


What I need to do is the instant one user 'selects' a grid record, even though no action is taken, I need to prevent anyone else from also potentially using them.

So the lock will be on instant the grid record is selected. (ticked)
It will become unlocked, when the UBE has finished processing or the user clicks cancel.

I've already tested this and even you click &Cancel, the Grid Record is Unselected event is not fired :(

So I'll have to loop selected records in the &Cancel and unlock them
seems like you might end up with a race condition if two users click the same record at the same time. Not only that, but what if they close their browser window,computer crashes,laptop battery dies? Someone would end up with the old call to get the reservation removed.

To what Chan had said, this is what JD Edwards does (think F4211/F4201, GENKEY is created using F4201 fields and locking out anyone else from that order)
Here is one suggestion,
1. Implement record lock/unlock on the UBE to minimize the locking time
2. Check for the lock on the row selected event and notify user to wait and refresh the grid/reselect the row. Enable the row exit only if there is no lock for that row.

This way, the UBE handles all locking and unlocking, and prevent orphan records on the reservation table.