1. Ashutosh Varshney
  2. PowerBuilder
  3. Tuesday, 27 September 2022 14:26 PM UTC

Hello folks,

I have run into a weird issue. I am using PB 2021 - 1228.

I have a datawindow which has a column - member_id. There is a function in my application which tries to get this value.

// of_GetInfo
String			ls_mID
.
.
.
.

ls_mID = dw_1.Object.member_id[1] // Error

//ls_mID = dw_1.GetItemString (1, 'member_id') // This works

When I try to get the column's value using dot notation, I get this error - Error accessing external object property member_id at line 22 in function of_GetInfo of object w_profile.

But GetItemString for the same row/column works fine.

Any ideas what is wrong?

Thanks.

Andreas Mykonios Accepted Answer Pending Moderation
  1. Tuesday, 27 September 2022 15:09 PM UTC
  2. PowerBuilder
  3. # 1

What is the datatype for your column? What does Getitemstring returns? Getitemstring is a function and will return empty string if your column is of wrong datatype or doesn't exists.

If member_id is numeric then you will get it's value using dot notation like this:

ls_mID = string(dw_1.Object.member_id[1])

Andreas.

Comment
  1. Ashutosh Varshney
  2. Tuesday, 27 September 2022 15:26 PM UTC
Column type is char
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 27 September 2022 14:58 PM UTC
  2. PowerBuilder
  3. # 2

Hi, Ashutosh -

Is this a column that has been dynamically added (via code)?

Is this a dynamically created DW data object?

Is it possible for you to try the same action in an earlier version of PB to see if it behaves strangely there?

Also, can you try referencing the single row/column item in dot notation via the "Data" keyword? For example, if member_id is column number 5, then

ls_mID = dw_1.Object.Data[1,5]   // Row 1, Column 5

Regards, John

Comment
  1. Ashutosh Varshney
  2. Tuesday, 27 September 2022 15:35 PM UTC
Negative to the first two questions. It makes no sense - the same function works fine in a previous version of the application (Same PB version).

I tried ls_mID = dw_1.Object.Data[1,66] - Got Error accessing external object property data at line 26 in function of_GetInfo of object w_profile.

GetItemString (1, 66) works ok.
  1. Helpful
  1. John Fauss
  2. Tuesday, 27 September 2022 15:57 PM UTC
OK. It is likely a bug. I suggest opening a support ticket.

Have you tried regenerating the DW data object and optimizing the pbl in which it resides?

If this was happening to me, I would also try exporting the DataWindow, editing & inspecting the .srd file to see if there was anything that appeared unusual, particularly in regards to the member_id column object syntax. If it looks OK, try importing it into a work/scratch pbl and test again.
  1. Helpful 1
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.