Invalid Datawindow row/column specified at line 80 in itemchanged event

PB 10.5
I'm getting Powerbuilder Application Execution Error (R0006). Error; Invalid Datawindow row/column specified at line 80 in itemchanged event of object dw_ucc of w_scan_items.

Attached is the code where this error is being thrown. Any ideas what could be causing this? how to fix this?

long ll_row_cnt, ll_row_cnt2
		string  ls_bin
		int li_pick, li_new_row
		for ll_row_cnt = 1 to dw_retrieve_ucc.rowcount()
			ls_agin = dw_retrieve_ucc.getitemstring(ll_row_cnt, "agin")
			li_pick = dw_retrieve_ucc.getitemnumber(ll_row_cnt, "assign_qty")
			ls_bin = dw_retrieve_ucc.getitemstring(ll_row_cnt, "oflin")
			for ll_row_cnt2 = 1 to li_pick
				li_new_row = dw_seq.insertrow(0)
				dw_seq.setitem(li_new_row, "agin", ls_agin)
				dw_seq.setitem(li_new_row, "assign_qty", 1)
				dw_seq.setitem(li_new_row, "bin", ls_bin)
				dw_seq.setitem(li_new_row, "pick", "N")

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Which is line 80?
This error means what it says.  Either a row number you are using doesn't exist, or the column you are accessing doesn't exist.
coperations07Author Commented:
ls_agin = dw_retrieve_ucc.getitemstring(ll_row_cnt, "agin")

This line is row 80.
The column names are correct for the dw. I'm inserting a row to start w/, so how could it not exist? This is what I've been trying to figure out.
Is the InsertRow failing?
You might check if it returns -1.
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

coperations07Author Commented:
It shows a positive 1
1) check "agin" is the correct column name in datawindow dw_retrieve_ucc.
2) Check the value of ll_row_cnt by putting messagebox() before this line.
3) Are you doing any manipulation of dw_retrieve_ucc also (insert row or delete row)?
4) Try changing below line
for ll_row_cnt = 1 to dw_retrieve_ucc.rowcount()
long ll_rowcount
ll_rowcount = dw_retrieve_ucc.rowcount()
for ll_row_cnt = 1 to ll_rowcount

coperations07Author Commented:
Alright. I found out what the problem was. Somehow I managed to change the names/DataObjects of a couple of the datawindows that were on the main window. I have no idea how this happened as I'm sure I didn't type different names in for them. This program has worked fine in the past, so I had to have changed these names some how. Can the names be changed by double clicking datawindows or anything like that?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Does that mean...dataobject assigned to datawindow control was wrong? To change dataobject for datawindow control you right click on datawindow control and go to it's property and change it.

Double check if in your program dataobject is changed dynamically for a datawindow control.

dw_retrieve_ucc.Dataobject = 'some_datawindow_object_name'

coperations07Author Commented:
yes. I had to change the dataobject in the properties of a couple of datawindows. I'm still not sure how they got changed. There's nothing in the code that would set the dataobject equal to anything else.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.