1. Raymond Longoria
  2. PowerBuilder
  3. Friday, 5 February 2021 17:42 PM UTC

I migrated a Powerbuilder application from 8.0 to 2019 R2. I have a Getchild call that is returning -1 but it works in 8.0. There have been no modifications. Is there something I should consider about the datawindowchild after a migrationmigra?

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 23 February 2021 22:31 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi, Raymond -

I can understand how frustrating this situation is for you.

If I were in your shoes, I would get "out of the box creative" to see if I could perform the same or similar GetChild and get return code of 1...from anywhere in the window - here are some ideas:

1. Declare another DataWindowChild reference variable and try the GetChild using the new variable.

2. If the failing DataWindowChild reference variable is an instance variable, see if a locally-scoped variable works.

3. Try issuing the GetChild from other scripts in the same window. Maybe even temporarily adding a "Click Me!" command button to the window and test the GetChild in the Clicked event.

4. Code a new GetChild call in a window function, then call that function from the spot where the failing GetChild is being called from now. Call it normally (Trigger), try it by Posting the function call.

5. Verify the requested column name exists in the DW, not only by inspection, but try issuing a Describe function that references a property of that column object, then check the result.

I'm sure that are other things you can try...these are what I thought of while typing.

Hopefully you will discover one or more ways to successfully invoke the GetChild function. If that doesn't give you any clues why the original GetChild is failing, report your findings back here (specifically, what you tried, what worked, what didn't work) and we'll bonk our collective heads around some more.

Good luck!



Thanks for sharing the solution Raymond!
  1. Armeen Mazda @Appeon
  2. Friday, 26 February 2021 20:23 PM UTC
You're welcome, Raymond. I'm glad you were able to figure it out!
  1. John Fauss
  2. Friday, 26 February 2021 20:26 PM UTC
Hi Raymond ... I wish that ALL PB Developers moved their code from the OPEN => Post Open and Constructor => Post Constructor user events. My SYD Framework did that back around PB 5 time frame and I have never had issues like yours ever since up to now PB/PS2021 beta. My personal recommendation is to never use the Open/Constrictor events for App coding. Just my $0.02. ;-)

Regards ... Chris
  1. Chris Pollach @Appeon
  2. Friday, 26 February 2021 21:11 PM UTC
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 5 February 2021 17:56 PM UTC
  2. PowerBuilder
  3. # 1

Hi Raymond;

   FWIW:  I have lots of R2 Test Apps that use a GetChild and there are no GetChild issues logged in the Appeon Support DB. So you might need to review your App's code. Especially where & when the command is used as since PB 8 - some events have a different timing order. This was mainly done by Sybase in the PB10 (new Unicode era), PB 11.x (.Net support) and PB 12.x as 64 bit support was added. Appeon added a few changes to that area as well in PB2017=>2019.

FYI:  http://docs.appeon.com/pb2019/migrating_pb_apps/index.html


Regards ... Chris

There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Friday, 5 February 2021 17:52 PM UTC
  2. PowerBuilder
  3. # 2

When you migrated, did you checK the AUTO-CONVERT button, as well as the WARNING and ERROR messages options?

If so, then what do you get when you run the dddw:
1. in the dw painter?
2. in the app in debug mode?
3. when you take and simply run the sql for the dropdown?


Yes I checked all of those and I didn't see anything related to this. I compared the Getchild call to another window in the same application, working with the same datawindow and there is no error.

I run it in debug mode and I get -1 on the Getchild call.

I did a retrieve on the datawindow in the dw painter and it retrieves the data.

  1. Raymond Longoria
  2. Tuesday, 23 February 2021 21:02 PM UTC
There are no comments made yet.
  • Page :
  • 1

There are no replies made for this question yet.
However, you are not allowed to reply to this question.