
We are looking to do some advanced validation in the receipts screens which requires us to iterate through the inventory items on the receipt screen and subsequently iterate through the lot records on the associated Lot/Serial screen. I can get the code to run through the inventory item lines, but when I pull the data for the Lot/Serial records, it is only pulling the most recent line item.
For example:
Although I can iterate through and get 2 records out of the main grid handle (A/B), each iteration of the lot/serial records only provides me the lots associated with the last inventory item I opened the Lot/Serial screen on. If I were simply concatenating a message box it would look something like the following if I had opened inventory item B Lot/Serial last.
Not sure what I'm missing on how to move the memory buffer for the sub-screen.
MESSAGE BOX
Inventory Item A, Lot B123, Lot B456, Lot B789;
Inventory Item B, Lot B123, Lot B456, Lot B789;
GridHandle = GetGridHandle("Spread1")
If GridHandle <> 0 Then
Row = MGetRowNum(GridHandle)
End If
serr1 = MFirst(GridHandle, MaintFlag)
While serr1 = 0
Call GetBufferValue("bpotran.InvtID", strInvtID)
strMsg = strMsg & "Inventory Item " & strInvtID
LS_GridHandle = GetGridHandle("LS_Spread2")
If LS_GridHandle <> 0 Then
Row2 = MGetRowNum(LS_GridHandle)
End If
serr2 = MFirst(LS_GridHandle, MaintFlag)
While serr2 = 0
Call GetBufferValue("blotsert.LotSerNbr", theLot)
strMsg = strMsg & ", Lot " & theLot"
serr2 = MNext(LS_GridHandle, MaintFlag)
Wend
strMsg = strMsg & ";" & chr(10)
serr1 = MNext(GridHandle, MaintFlag)
Wend
*This post is locked for comments
I have the same question (0)