Is it possible to know which buffer-field threw error 11913

Posted by Rom Elwell on 14-Nov-2014 14:41

Setup:  Win7 64-bit running OE10.2B08

When a buffer passed to SAVE-ROW-CHANGES throws an error,  is it possible to discern which buffer-field caused the error to be thrown?  

We are testing concurrency error-handling, and it is possible the user would have changed 1 to n field values in the buffer-row passed to SAVE-ROW-CHANGES.  We are being asked to provide the name of the field that caused the concurrency error (error code 11913) so that the UI can notify the user via a visual cue.

Posted by Mike Fechner on 17-Nov-2014 08:48
Rather than looping through the _field records, I'd loop through the buffer-fields of the two (or more) buffers involved. Buffers are available at least as soon as you attach-data-source. And buffers have all meta schema information available as well.

Von meinem Windows Phone gesendet

Von: gabriel.lucaciu
Gesendet: ‎17.‎11.‎2014 15:42
An: TU.OE.Development@community.progress.com
Betreff: RE: [Technical Users - OE Development] Is it possible to know which buffer-field threw error 11913 when passed to SAVE-ROW-CHANGES?

Reply by gabriel.lucaciu

Hi,

As far as i know there is no possibility to see from the error which is the actual field that was changed. But I think you can make a loop through the fields (_field) of the database table on the row from database and see which one is different in the before-table of the data-set.

Does this make sense to you or you need more info on this solution ?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

All Replies

Posted by gabriel.lucaciu on 17-Nov-2014 08:41

Hi,

As far as i know there is no possibility to see from the error which is the actual field that was changed. But I think you can make a loop through the fields (_field) of the database table on the row from database and see which one is different in the before-table of the data-set.

Does this make sense to you or you need more info on this solution ?

Posted by Rom Elwell on 17-Nov-2014 08:45

Gabriel,  This makes sense, thank you for the feedback.  I will need to do some testing to confirm the results and will post back here when I have more info to share.

Posted by Mike Fechner on 17-Nov-2014 08:48
Rather than looping through the _field records, I'd loop through the buffer-fields of the two (or more) buffers involved. Buffers are available at least as soon as you attach-data-source. And buffers have all meta schema information available as well.

Von meinem Windows Phone gesendet

Von: gabriel.lucaciu
Gesendet: ‎17.‎11.‎2014 15:42
An: TU.OE.Development@community.progress.com
Betreff: RE: [Technical Users - OE Development] Is it possible to know which buffer-field threw error 11913 when passed to SAVE-ROW-CHANGES?

Reply by gabriel.lucaciu

Hi,

As far as i know there is no possibility to see from the error which is the actual field that was changed. But I think you can make a loop through the fields (_field) of the database table on the row from database and see which one is different in the before-table of the data-set.

Does this make sense to you or you need more info on this solution ?

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Posted by Rom Elwell on 17-Nov-2014 09:10

Thanks Mike!  I was aware I could loop through the buffer-fields, but wanted to make sure I checked that ABL did not already have a method that would return the info.  I will mark your answer to close this thread.

Posted by Freddy Boisseau on 23-Feb-2017 14:55

Looping through the buffer fields and checking their values, does not always let you know which fields is causing the issue.  I had that happen to me recently.  Having the SAVE-ROW-CHANGES or the BUFFER-COMPARE return the differences, would help debugging and also letting the user know what the issue could be.

Posted by Tim Kuehn on 23-Feb-2017 15:12

you have the before-buffer - going through it and comparing it to the current record should reveal which fields had changed.

Posted by Peter Judge on 23-Feb-2017 16:02
You may be able  to use the BUFFER-COMPARE *statement* (not function) which can save the differing fields in a char value.
 
You could then compare the values of those fields to the DB fields (getting the mapped values from the ATTACHED-PAIRLIST attribute off the (TT) buffer handle where needed).
 
 
This thread is closed