Consultor Eletrônico



Kbase P38388: Buffer-delete method raises an error when the delete fails
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Verified

FACT(s) (Environment):

Progress 9.1x
OpenEdge 10.0x
OpenEdge 10.1B

SYMPTOM(s):

Buffer-delete method raises an error when the delete fails

Various errors may occur

CAUSE:

This is expected behavior.

It is not possible to use BUFFER-DELETE in a statement like:

IF hBuf:BUFFER-DELETE() then message "The record was deleted".
ELSE message "The delete operation failed".

Even if the BUFFER-DELETE returns a logical value because in case of an error (eg. the database delete trigger will return an error) the BUFFER-DELETE method will raise an error and the statement - message "The delete operation failed" - will be never executed.

The reason for this is that errors during delete of a record can have an impact on the database that is too severe to be ignored.

FIX:

Use BUFFER-DELETE with NO-ERROR.

Example:

lOk = hBuf:BUFFER-DELETE() NO-ERROR.
if lOK then message "The record was deleted".
ELSE message "The delete operation failed".

In OpenEdge 10.1B and later releases, the documentation has been updated to reflect this.