ABL Classic GUI: apply 'value-changed' causes buffer

Posted by cverbiest on 21-Nov-2013 04:00

Hi,

I just saw some weird behaviour (OE10.2B07) and I was wondering if this was some kind of known behaviour/issue.

We have some legacy code that does the following (pseudo code, not the actual code) :

new: do transaction:

  create record. /* only used to get initial values */

  run display_record.

  run post_display_record.

  undo new. /* undo the create of the record */

end.

procedure post_display_record:

    apply 'value-changed' to screen_variable.

end.

The apply value-changed causes the record to be written to the db. (this fails on mandatory fields as it is not supposed to be written to the db).

It does not matter if the value-changed trigger actually contains code or not.

If I replace apply 'value-changed' by run valuechanged the record is not written to the db.

There is no code that changes the record. To check this I did a buffer-compare with another newly created record, in the post_display_record procedure, and they are identical.

BTW: I'm not particularly fond of this technique but it normally does the job.

All Replies

Posted by Brian K. Maher on 21-Nov-2013 07:40

I think we will need to see some more code.  Your problem description references "run valuechanged" but you don't give us the code so we can see what that does.

Posted by gus on 21-Nov-2013 09:16

I do not understand. What is "weird" about this behaviour?

Posted by cverbiest on 22-Nov-2013 06:08

Hi Brian and Gus

valuechanged is an empty procedure and value-changed trigger has an empty do block. It wasn't empty to start with but I removed all code to debugging the issue.

What I find weird is that there seems to be a difference in record scope when I use "apply value-changed" vs run value-changed. The UI trigger has nothing to do with the record.

I read the apply statement entry in the OpenEdge reference manual but I found no mention of buffer scoping .

Posted by Frank Meulblok on 25-Nov-2013 04:28

No idea why the 2 scenarios would behave differently.

As a quick suggestion, you could try running this code with the 4GLtrans logging active and see where you do and don't get sub-transactions; maybe that changes when triggers are involved.

This thread is closed