Trigger validation messages not showing

Posted by Admin on 04-Mar-2004 09:15

Hi there,

Dynamics 2.1A01

Progress 9.1d08

We have validations on database triggers which are not showing up. After some debugging I "may" have found the problem and also a possible Progress bug.

In refetchDBRow in query.p, locate:

/* 9.1D06 - Due to a core issue, FIND-BY-ROWID will not fire WRITE triggers. */

/* Releasing the buffer will properly fire any WRITE triggers and will return */

/* false if any trigger returned an error */

lFound = hBuffer:BUFFER-RELEASE().

IF lFound THEN

lFound = hBuffer:FIND-BY-ROWID(rRowid,SHARE-LOCK,NO-WAIT).

and change to:

/lFound = hBuffer:BUFFER-RELEASE()./

/IF lFound THEN/

lFound = hBuffer:FIND-BY-ROWID(rRowid,SHARE-LOCK,NO-WAIT).

This seems to fix the problem. For some really strange reason, BUFFER-RELEASE seems to generate an ERROR condition and return with ERROR-STATUS = FALSE, thus nothing happens, the record gets created (you can see it on the Browser) but if you press F5 it disappears. If you want to reproduce, try the following code. You will notice that Status#1 does not show and status#2 shows with ERROR-STATUS:ERROR = FALSE.

DEFINE VARIABLE buf AS HANDLE NO-UNDO.

DEFINE VARIABLE lfound AS LOGICAL NO-UNDO.

buf = BUFFER gsc_sequence:HANDLE.

DO TRANSACTION ON ERROR UNDO, LEAVE:

buf:BUFFER-CREATE().

lFound = buf:BUFFER-RELEASE(). /* Tried also with NO-ERROR */

MESSAGE "Status#1 " lFound ERROR-STATUS:ERROR SKIP RETURN-VALUE.

END.

MESSAGE "Status#2" lFound ERROR-STATUS:ERROR SKIP RETURN-VALUE.

All Replies

This thread is closed