Losing temp-table reference after a call to ShowDialog

Posted by jquerijero on 02-Aug-2019 21:24

I can't seem to find my original post regarding this issue, but it is about losing the current temp-table record in scope after returning from ShowDialog (and some other .NET method call) call. 

All Replies

Posted by Mike Fechner on 02-Aug-2019 21:54

Are you passing the temp table as an input-ourput parameter?

Sent from Nine

Von: jquerijero <bounce-jquerijero@community.progress.com>
Gesendet: Freitag, 2. August 2019 23:25
An: TU.OE.Development@community.progress.com
Betreff: [Technical Users - OE Development] Losing temp-table reference after a call to ShowDialog

Update from Progress Community
jquerijero

I can't seem to find my original post regarding this issue, but it is about losing the current temp-table record in scope after returning from ShowDialog (and some other .NET method call) call. 

View online

 

You received this notification because you subscribed to the forum.  To stop receiving updates from only this thread, go here.

Flag this post as spam/abuse.

Posted by jquerijero on 02-Aug-2019 22:43

It's not being passed as a parameter. Code structure is very simple.

FOR FIRST table:

  . . .

  Create an instance of a form

  form:ShowDialog() set dlgResult.

  if dlgResult is OK then

    table.field1 = form:Property1. // at this point, table is out of scope

 Delete form.

END.

I think someone has posted in my original post that it has something to do with how the code execution control is switch from .NET land back to ABL land. The context is somehow being lost. We encountered this error before, but the program is only dealing with one temp-table, so it is easy to just store the data needed and do the FIND again of the record outside of the FOR EACH for the update. However, for the current occurrence of the problem, there are already several different temp-table records in scope at the time the FOR EACH is executed that I'm afraid will also be forced to go out of scope.  

Posted by Laura Stern on 07-Aug-2019 14:53

Going off to .NET shouldn't matter.  Are there things you're doing with that TT buffer in response to what happens in the dialog box?  That might explain it.  Otherwise, I believe it is a bug.  So please log one.  Thanks.

Posted by Laura Stern on 07-Aug-2019 14:53

Going off to .NET shouldn't matter.  Are there things you're doing with that TT buffer in response to what happens in the dialog box?  That might explain it.  Otherwise, I believe it is a bug.  So please log one.  Thanks.

Posted by frank.meulblok on 07-Aug-2019 15:33

Do you really lose the record ? Or do you lose the values in the record ?

Big difference between the two, and I have a possible/likely explanation for the latter (which *does* lie on the .NET side of things...):

Properties of .NET dialogs aren't reliable when the said dialog gets Dispose()'d, including properties defined on the ABL side.

By default a Form's DisposeDialogOnClose is set to true, so that means it will be disposed when the dialog is closed and the ShowDialog() returns.

And there have been changes (I assume bug fixes) somewhere between 11.5.1 and 11.7.5. that will now cause property values to disappear at that point.

If you want to make sure these things keep working correctly, reset the dialog's DisposeDialogOnClose to False, and make sure you Dispose() it after you've extracted the properties you need.

Posted by Laura Stern on 07-Aug-2019 15:40

Sorry, I'm not following. Not sure what properties in a Form used as a dialog box has to do with the value of a TT record buffer.

Posted by Laura Stern on 07-Aug-2019 15:41

P.S.  My understanding is that the TT is not inside the form class, which is implied by the first post.

Posted by Laura Stern on 07-Aug-2019 15:41

P.S.  My understanding is that the TT is not inside the form class, which is implied by the first post.

This thread is closed