1. Romesh Bhavsar
  2. PowerBuilder
  3. Wednesday, 20 January 2021 18:39 PM UTC

I am receiving invalid datawindow / row column specified at line number even though both line and column exists in a datawindow.

code line is as per below.

dw_rhwork.setitem(1,"invoice",getitemstring(getrow(),"tch_in"))
dw_rhwork.setitem(1,"invoice_date",getitemdatetime(getrow(),"invoice_date"))

line #1 is okay but line # 2 is giving me error. Since first line is not giving any error 1 row is there in dw_rhwork and also getitemstring is having getrow.

I verified that invoice_Date field exists in both rows.

The code is working fine for most of the cases but sometimes it is giving error. We are working in citrix environment and application is accessed through exe file.

requesting a help on this because this is a business critical application

 

 

 

 

 

 

 

 

 

 

 

 

 

 

John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 20 January 2021 19:00 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Romesh - 

Incompletely qualified and nested method call such as these can be unclear and difficult to troubleshoot / debug. What DataWindow control (DWC) are the GetItemString, GetItemDatetime and GetRow methods being invoked against?

I suggest you first try including the DWC name with all methods to see if that helps. If it does not, put all methods in their own assignment statements to variables so that you can inspect the results using the debugger and verify you are getting the values you expect.

Regards, John

Comment
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Wednesday, 20 January 2021 19:14 PM UTC
  2. PowerBuilder
  3. # 2

1) make sure you don't have any spaces in the quoted field name. 

that is SOOOO easy to do if you copy and paste names.  the display in the PB ide often make it impossible to see extra spaces, especially if you change your font.

" invoice" vs "invoice"

 

2) you are using:

getitemdatetime(getrow(),"invoice_date"))

this code would have to be in a function/event that is a datawindow that has a field name of "invoice_date" and that also has a row in it.  if that is not the case, you would get that error.

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 20 January 2021 19:28 PM UTC
  2. PowerBuilder
  3. # 3

Hi Romesh;

  FWIW: I would use a GetRow() command before the SetItemXxxxx() that fails to make sure that you have a current (valid) row number set in the DWO. Otherwise, the SetItemXxxx() would fail.  HTH

Regards ... Chris

Comment
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.