Many thanks in advance.
I'm fairly new to eConnect and am trying to get a POP receipt with serial number to work. My code (below) works if there are no serial numbers associated with the line item . However, I recieve this eConnect error when I try to add serial numbers:
Sql procedure error codes returned: Error Number = 3791 Stored Procedure taPopRcptSerialInsert Error Description = Required input parameter contains an empty value in the taPopRcptSerialInsert stored procedure Node Identifier Parameters: taPopRcptSerialInsert POPRCTNM = REC_001693_25 ITEMNMBR = PP1000SE PCI SERLTNUM = 100012155633256 RCPTLNNM = 0 <taPopRcptSerialInsert><POPRCTNM>REC_001693_25</POPRCTNM><ITEMNMBR>PP1000SE PCI</ITEMNMBR><SERLTNUM>100012155633256</SERLTNUM><RCPTLNNM>0</RCPTLNNM></taPopRcptSerialInsert>
Private Sub LoadReceivings()
Dim ReceiptHeaderTableAdapter As New dsReceivingsTableAdapters.ReceiptHeaderTableAdapterDim ReceiptHeaderTable As New dsReceivings.ReceiptHeaderDataTable
Dim ot As String = ""
ReceiptHeaderTableAdapter.Fill(ReceiptHeaderTable)
'Set order counter
intReceiptCount = ReceiptHeaderTable.Rows.Count
'List the number of orders that will be processedFor Each ReceiptHeaderRow As DataRow In ReceiptHeaderTable.Rows
'set the current row number
intReceiptCurrentRow = intReceiptCurrentRow + 1
'Get the Recievings ref numberIf Not IsDBNull(ReceiptHeaderRow.Item("POPRCTNM")) Then strPOPRCTNM = ReceiptHeaderRow.Item("POPRCTNM").ToString
strBachNumb = ReceiptHeaderRow.Item(
"BachNumb").ToStringDim ReceiptDetailAdapter As New dsReceivingsTableAdapters.ReceiptLineTableAdapterDim ReceiptDetailTable As New dsReceivings.ReceiptLineDataTable
ReceiptDetailAdapter.FillByPOPRCTNM(ReceiptDetailTable, strPOPRCTNM)
intNumLines = ReceiptDetailTable.Rows.Count - 1
If intNumLines > -1 ThenReDim LineItems(intNumLines)
intCurrentLine = 0
'loop through the line items for this receiptFor Each ReceiptDetailRow As DataRow In ReceiptDetailTable.Rows
'Get the item numberstrITEMNMBR = ReceiptDetailRow.Item("ITEMNMBR").ToString()
strVENDORID = ReceiptDetailRow.Item(
"VENDORID").ToStringstrVNDITNUM = ReceiptDetailRow.Item("VNDITNUM").ToString
intQTYSHPPD = ReceiptDetailRow.Item(
"QTYSHPPD")strUOFM = ReceiptDetailRow.Item("UOFM").ToString
fltUnitCost = ReceiptDetailRow.Item(
"UnitCost").ToStringintNonInven = ReceiptDetailRow.Item("NonInven").ToString
strLOCNCODE = ReceiptDetailRow.Item(
"LOCNCODE").ToStringstrPONUMBER = ReceiptDetailRow.Item("PONUMBER").ToString
intINVINDX = ReceiptDetailRow.Item(
"INVINDX").ToStringstrVENDNAME = ReceiptDetailRow.Item("VENDORID").ToString
intPOLNENUM = ReceiptDetailRow.Item(
"POLNENUM").ToStringstrVNDITDSC = ReceiptDetailRow.Item("VNDITDSC").ToString
strITEMDESC = ReceiptDetailRow.Item(
"ITEMDESC").ToStringintItmTrKop = ReceiptDetailRow.Item("ItmTrKop").ToString
BuildOrderDetail(intCurrentLine)
If intItmTrKop = 2 ThenDim ReceiptSerialAdapter As New dsReceivingsTableAdapters.ReceiptSerialNumbersTableAdapter
Dim ReceiptSerialTable As New dsReceivings.ReceiptSerialNumbersDataTableDim ReceiptFullSerialAdapter As New dsReceivingsTableAdapters.TPG10201TableAdapterDim ReceiptFullSerialTable As New dsReceivings.TPG10201DataTable
ReceiptSerialAdapter.FillBy(ReceiptSerialTable, strITEMNMBR, strPOPRCTNM)
intNumSerials = ReceiptSerialTable.Rows.Count - 1
If intNumSerials > -1 ThenReDim SerialNumbers(intNumSerials)
Dim SERLTNUM As String = ""
Dim FullSerialNumber As String = ""For Each SerialDetailRow As DataRow In ReceiptSerialTable.Rows
SERLTNUM = SerialDetailRow.Item(
"SERLTNUM").ToStringFullSerialNumber = SerialDetailRow.Item("FullSerialNumber").ToString
BuildSerialNumbers(strPOPRCTNM, strITEMNMBR, intCurrentLine, SERLTNUM)
ReceiptFullSerialAdapter.Insert(strITEMNMBR, SERLTNUM, FullSerialNumber)
NextReDim Preserve Receivings.taPopRcptSerialInsert_Items(intNumSerials)
Receivings.taPopRcptSerialInsert_Items = SerialNumbers
End If
End If
intCurrentLine = intCurrentLine + 1
NextReDim Preserve Receivings.taPopRcptLineInsert_Items(intNumLines)
Receivings.taPopRcptLineInsert_Items = LineItems
'build the order header
BuildReceiptHeader()
'Add the header node to the transaction type object
Receivings.taPopRcptHdrInsert = ReceiptHdr
eConnectImport()
If bolReceiptImportError = False Then
'If update is checked, update the dataReceiptDetailAdapter.UpdateQuery(1, Date.Now, strErrDesc, Current.Session("UserName"), strPOPRCTNM)
ElseReceiptDetailAdapter.UpdateQuery(0, Date.Now, strErrDesc, Current.Session("UserName"), strPOPRCTNM)End If
'End If
bolReceiptImportError =
False
End IfNext
'reset counters
intReceiptSuccessCount = 0
intReceiptCurrentRow = 0
End Sub
Kevin Vogler