Trouble with the "END-ERROR" - Trigger...

Storzum

Member
Hello,

I have a program (A) which calls a Dialog (B)
using a run-statement.
This Dialog (B) calls another Dialog (C) also with
a run-statement.

In Dialog (C) I create a record:
Code:
    DO WITH FRAME Frame-A:
            CREATE Table1.
            ASSIGN
                Table1.Value1 = Fill-In-1
                Table1.Value1 = Fill-In-2.
     END.
Then I leave Dialog (C) with a Button from a Toolbar
which calls a procedure (BtnEnd).
In BtnEnd I always Apply to "END-ERROR":
APPLY "END-ERROR":U TO SELF.

But after that Apply my created record is gone.

Hm.
Then I have tasted:
APPLY "GO":U TO SELF.

With this "GO" in (C) the record wasn`t deleted.

But in (B) is also an "END-ERROR" - Apply when leaving.
And then the record was deleted.

In A, B and C are not any transactions.

I don`t know why the record is deleted.

We have always used the "END-ERROR"-Apply, and never have
had such a behavior.

I work on Win XP SP2 with Progress 9.1d.

Could someone give me a hint?

Greets
Storzum
 

TomBascom

Curmudgeon
You should not be using END-ERROR in the way that you describe. It doesn't make sense to deliberately raise an error condition to "end" normal processing. You should be using GO instead.

Compile your code with the XREF option. You will see that even though you have not declared a transaction with the TRANSACTION keyword you do, indeed, have a transaction active. (You could also embed MESSAGE TRANSACTION. statements to see this.)

If your sample code is typical then you probably also need to step back and carefully review the concepts of record, lock and transaction scope.
 
Top