You can also try the time-saving prefix... (which doesn't always work, but it's worth a test).
retVal = oLines.GetValue("Item.ItemCodeDesc$", tmpItemDesc)
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
Toronto ON
------------------------------
Original Message:
Sent: 10-14-2020 07:39
From: Amber Prayfrock
Subject: Help with Lines Loop script
Thank you to Kate and Alnoor for your suggestions! I will make those changes today. I had changed to GetChildHandle from GetObject because the connection was failing for non-administrator users, for some reason, but I didn't realize I wasn't using it properly when looping through lines.
------------------------------
Amber Prayfrock, Blytheco
------------------------------
Original Message:
Sent: 10-14-2020 01:15
From: Alnoor Cassim
Subject: Help with Lines Loop script
@Amber Prayfrock - What Kate said! She also uses a lot of oScript.DebugPrint() in her code which would help you here.
Also it appears like when you do:
if Not(IsObject(oItemSale)) then
set oItemSale = oLines.AsObject(oLines.GetChildHandle("ItemCode"))
all the code below the set oItemSale through the End If would only run once because oItemSale is an object by the time it enters the 2nd iteration of the loop.
Ergo one way to deal is make the stmt inline like this:
if Not(IsObject(oItemSale)) then set oItemSale = oLines.AsObject(oLines.GetChildHandle("ItemCode"))
'also comment out the End If below the oLines.Write() like this:
'end if
Alternatively you could omit the If/Then:
set oItemSale = oLines.AsObject(oLines.GetChildHandle("ItemCode"))
'also comment out the End If below the oLines.Write() like this:
'end if
Hope that helps.
------------------------------
Alnoor Cassim
Email: alnoor@asifocus.com
Ph: 949-689-9887
Orange County, CA
Original Message:
Sent: 10-14-2020 00:30
From: Kate Krueger
Subject: Help with Lines Loop script
Hi Amber!
Have you tried adding a "find" statement after you establish connection to oItemSale? I'd expect to see
retval = oItemSale.Find(sItemCode)
right after you set oItemSale. At the very least you can throw a debugging line in there after the find statement to confirm that it is actually locating the right item code for each line.
------------------------------
Kate Krueger
Business Applications Manager
Eide Bailly, Inc.
Denver CO
970-692-5113