In order for this site to work correctly, and for us to improve the site, we need to store a small file (called a cookie) on your computer.
By continuing to use this website, you agree to our cookies and privacy policy.
Home page Home page Home page Home page
Pixel Header R1 C1 Pixel
Pixel Header R2 C1 Pixel
Pixel Header R3 C1 Pixel

Reader's Clinic - Preventing Records Being Amended

A user in Cardiff had a problem recently with trying to find an easy way of preventing records from being amended when certain trigger fields had been filled in. That is, they wished to allow time-sheets to be entered and amended UNTIL an invoice had been produced. After the invoice was produced (and the invoice number was stored in the time-sheet record) the user had to be able to call up the time-sheet on screen and scroll through all values but not amend anything. The question was - "What is the most efficient way of achieving this ?"

The initial solution of setting all of the fields to protected worked but was cumbersome. A more elegant solution was achieved by the realisation that when a record is locked on the network, no editing is possible. Once this was realised, duplicating this functionality provided the better solution. The answer was to use a replace read process coded as follows

0003         IF @RECORD<55> THEN
0004            * Or whatever condition you wish to assign
0005            WC_WLOCKED% = 0
0006            UNLOCK WC_SRC_FILE%, @ID
0007         END
0008      END ELSE
0009         @RECORD = ""
0010      END

The WC_WLocked% = 0 instructs the window processor that the record could not be locked and is therefore NOT available for editing. However because the window processor thinks that the record is locked it will not attempt to unlock it after the record has been exited. The record must therefore be explicitly unlocked by the process.

(Volume 1, Issue 7, Page 3)
Pixel Footer R1 C1 Pixel