I have a working Receipt of Goods Visual Studio VB console app. It's an integration project. I have a textfile that has the receiving data. It's easy enough to MoveFirst and MoveNext and match the text data to the PO Line using LineKey (or I could use Item or both).
I was hoping to make a more elegant solution. Since I have the LineKey (000001, 000002, etc), I thought I could use EditKey and EditLine and skip the MoveFirst and MoveNext but GetEditKey is giving me null.
Here's the code (not testing return values unless I have to for now while I'm messing around):
r = oBUS.nGetNextReceiptNo(RNo)
r = oBUS.nSetKeyValue("ReceiptNo$", RNo)
r = oBUS.nSetKey()
r = oBUS.nSetValue("PurchaseOrderNo$", PONo)
r = oBUS.nCopyPurchaseOrderLines(0) '0 do not set qtys, 1=receive complete
Do Until txtline = ""
EditKey = oBUS.oLines.sGetEditKey(LineKey) 'I have the line key from txtline (example 000001 or 000002)
MsgBox("editkey " & EditKey)
r = oBUS.oLines.nEditLine(EditKey)
r = oBUS.oLines.nGetValue("ItemCode$", LItem)
r = oBUS.oLines.nGetValue("LineKey$", LLineKey)
I'm baffled as to why this is not working. There is obviously something I am not understanding.
EditKey is DIM as string and I set it to "" in the very beginning:
Dim EditKey As String
EditKey = ""