«

»

Jul 12 2014

Record Reservation [Basic Code Tips]

VN:F [1.9.22_1171]
Rating: 4.3/5 (6 votes cast)

Data Security IntegrityJust posting basic code tips – vis a vis Standard Record Reservation (P00095)

The Record reservation is used to lock records within an application so that none else would be able to modify it over at the same time, basically to retain data integrity. One can then release locked records using the standard application – P00095 in case they are hanging out locked.

--------------------------------------
EVENT: Dialog is Initialized
--------------------------------------
VA frm_GenericKey_GENKEY = concat([BC mnDocumentNumber DOCO],[BC szDocumentType DCT])

// THIS FUNCTION RESERVES THE RECORD, RESTRICTS OTHER USERS FROM UPDATING
F00095 Reserve Object
     "F4201" -> szNameObject
     SL UserID -> szUserId
     "1" -> cSuppressErrorMessage
     VA frm_RecordResErrorMsg_DTAI <- szErrorMessageID
     VA evt_RecordReservedBy_ALPH <- szReserversNameAlpha
     "P554210" -> szApplication
     VA frm_GenericKey_GENKEY -> szGenericKey
     VA evt_ReservedbyAppID_PID <- szReserversApplication
     UNDEFINED -> cWarningError

If VA frm_RecordResErrorMsg_DTAI is greater than <Blank>
// THIS FUNCTION SETS THE ERROR ON THE FORM
  Set OBject Reservation Text Substitution Error
     VA evt_RecordReservedBy_ALPH -> szReserversNameAlpha
     VA frm_GenericKey_GENKEY -> szGenericKey
     VA evt_ReservedbyAppID_PID -> szApplication
     UNDEFINED X cWarningError
  // WRITE CODE HERE TO DISABLE THE VALUES FOR EDIT, OR DISABLE UPDATE
Else
  // OBJECT RESERVATION SUCCESSFUL
End If

Once the record reservation is successful, you need to unlock it at the end of use.

-----------------------------------------------------------------------
EVENT: End Dialog
-----------------------------------------------------------------------
// THIS FUNCTION WILL CLEAR USER OR FILE OR APP FOR THE RECORD

F00095 Remove Business Object Reservation
     SL UserID -> szUserId
     "F4201" -> szNameObject
     UNDEFINED -> szGenericKey
     "P554210" -> szApplication

Published under the license.

VN:F [1.9.22_1171]
Rating: 4.3/5 (6 votes cast)
Record Reservation [Basic Code Tips], 4.3 out of 5 based on 6 ratings
(Visited 943 times, 1 visits today)

About the author

Deepesh M Divakaran

Deepesh MD is more of a Gizmo Geek, and a techie.
A very experienced Technical Consultant on Oracle JD Edwards EnterpriseOne, and OneWorld. As a consultant he has worked for wide range of industries, from Manufacturing, Media, Oil & gas etc. and has worked on re-engineering modules, and areas of customization.
With a touch of class and understanding towards what ever he does, he is often regarded by his colleagues as the one stop answer for all Technical/Software related queries.

2 comments

  1. Brandon Kirsch

    Your example to place a business object reservation is missing one of the most important parameters: szGenericKey!

    The top BSFN call should look more like:

    F00095 Reserve Object
    “F4201” -> szNameObject
    SL UserID -> szUserId
    “1” -> cSuppressErrorMessage
    VA frm_RecordResErrorMsg_DTAI <- szErrorMessageID
    VA evt_RecordReservedBy_ALPH szGenericKey
    “P554210” -> szApplication
    VA evt_ReservedbyAppID_PID cWarningError

    VA:F [1.9.22_1171]
    Rating: +1 (from 1 vote)
    1. Deepesh M Divakaran

      Thanks for pointing that out. Have updated it.

      VN:F [1.9.22_1171]
      Rating: +1 (from 1 vote)

Leave a Reply