1. Andrew Davis
  2. PowerBuilder
  3. Wednesday, 22 February 2023 11:07 AM UTC

Hi All

I think this should be easy - but i am having  a blank !

I want to know what dataobject is assigned to my datawindow - maybe in my code or is set during runtime

I can set it like this dw_1.dataobject='dw_bag_label_packing_with_van' or it is set in the window before the programme is run

How do i see what dataobject is assigned - during the runtime - so i can display it in a text field.

 

regards and thanks in advance

 

andrew

 

 

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 22 February 2023 12:37 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi, Andrew -

You answered your own question: Use the DataObject property of the DataWindow control. It will either be an empty string or the name of the currently assigned Data Object.

Best regards, John

Comment
  1. Andrew Davis
  2. Wednesday, 22 February 2023 12:54 PM UTC
yep

ls_text=dw_1.dataobject



I was sure i tried this and got an ! - but it is working

Many thanks
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 23 February 2023 15:38 PM UTC
Just be careful though as an assigned DWO name does *not* mean that it's valid DWO.

For example: DC/DS.dataobject = "dw_chris_junk" // does not exist

So the only way to know that the DC/DS's DWO is valid is to check it using a Describe() command. HTH
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.