Hi Team,
i would like to update the selected batch number info in pick list. However, i found that it is not straight forward to update the pick list's selected batch/serial numbers. It has to match back the whatever the BASE doc (SO) selected batches info.
To enable to do it, currently every time i clear all the selected batches in SO and add back to SO, so that Pick List able to assign my new selected batches info.
But, the problem now is what if i have release a same SO to 2 pick lists. When i do updating in another pick list, it will wipe off the previous selected batches in SO. Exp:
SO Doc 1
item A - released 4 qty
Batch Number A,B,C,D
Pick List 1 - based SO Doc 1
item A - released 1 qty
Batch Number A
Pick List 2 - based SO Doc 1
item B - released 2 qty
Batch Number B,C
Updating Pick List 2
Change Batch Number B,C to C,D
Now the SO Doc 1 become
Batch Number C,D
For iColBatch As Integer = 1 To collBatch.Count
dviewBinBatchNo = New DataView(dtBatchNo)
dviewBinBatchNo.RowFilter = "PickEntry = '" & PickEntry & "' And BatchNo = '" & collBatch.Item(iColBatch) & "'"
oDocument.Lines.BatchNumbers.SetCurrentLine(iColBatch - 1)
oDocument.Lines.BatchNumbers.Quantity = dviewBinBatchNo(0)("Quantity")
oDocument.Lines.BatchNumbers.BatchNumber = dviewBinBatchNo(0)("BatchNo")
intTotalRow = dviewBinBatchNo.Count
For intBinRowCount = 0 To intTotalRow - 1
If dviewBinBatchNo(intBinRowCount)("BinCode") <> "" Then
oDocument.Lines.BinAllocations.SetCurrentLine(oDocument.Lines.BinAllocations.Count - 1)
oDocument.Lines.BinAllocations.BinAbsEntry = dviewBinBatchNo(intBinRowCount)("BinAbsEntry")
'oDocument.Lines.BinAllocations.BaseLineNumber = oDocument.Lines.Count - 1
oDocument.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = oDocument.Lines.BatchNumbers.Count - 1
oDocument.Lines.BinAllocations.Quantity = dviewBinBatchNo(intBinRowCount)("BinQty")
oDocument.Lines.BinAllocations.Add()
End If
Next
oDocument.Lines.BatchNumbers.Add()
Next
Can someone share the code which is working to assign selected new batches to pick list. Because every time i get the error 'Cannot add row without complete selection of batch number'. To resolve it, i need to clear whatever my current selected batches info in SO & Pick List and reassign back the new batches.