use of VST table _lock, to determining if record is lock

/*Below query checks if Purchase order 10765 is locked */


{us/mf/mfdtitle.i}
find first po_mstr where po_domain = global_domain and po_nbr = "10765"
exclusive-lock NO-WAIT no-error.
if avail po_mstr then
  Message po_nbr view-as alert-box.
If locked po_mstr then
do:
find first po_mstr where po_domain = global_domain and po_nbr = "10765"
no-lock no-error.
for first _lock where _Lock._Lock-Recid = Integer (RECID(po_mstr)) no-lock :
    find first _file where _File._File-Number = _Lock._Lock-Table no-lock
no-error.

   message _File._File-Name " is locked by user " _Lock._Lock-Usr
_Lock._Lock-Name view-as alert-box.
  End.

End.

Comments

Popular posts from this blog

Progress 4GL interview questions for QAD technology

QAD interview questions for SE and Eb2 version

Use of API in QAD EE