DynDeveloper.com

DynDeveloper.com

Sign Up Now!Log In
kvogler 5/12/2008 4:02:59 PM

Receiving with Serial Numbers

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.ReceiptHeaderTableAdapter

Dim 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 processed

For Each ReceiptHeaderRow As DataRow In ReceiptHeaderTable.Rows

 

'set the current row number

intReceiptCurrentRow = intReceiptCurrentRow + 1

'Get the Recievings ref number

If Not IsDBNull(ReceiptHeaderRow.Item("POPRCTNM")) Then strPOPRCTNM = ReceiptHeaderRow.Item("POPRCTNM").ToString

strBachNumb = ReceiptHeaderRow.Item("BachNumb").ToString

Dim ReceiptDetailAdapter As New dsReceivingsTableAdapters.ReceiptLineTableAdapterDim ReceiptDetailTable As New dsReceivings.ReceiptLineDataTable

ReceiptDetailAdapter.FillByPOPRCTNM(ReceiptDetailTable, strPOPRCTNM)

intNumLines = ReceiptDetailTable.Rows.Count - 1

If intNumLines > -1 Then

ReDim LineItems(intNumLines)

intCurrentLine = 0

'loop through the line items for this receipt

For Each ReceiptDetailRow As DataRow In ReceiptDetailTable.Rows

'Get the item number

strITEMNMBR = ReceiptDetailRow.Item("ITEMNMBR").ToString()

strVENDORID = ReceiptDetailRow.Item("VENDORID").ToString

strVNDITNUM = ReceiptDetailRow.Item("VNDITNUM").ToString

intQTYSHPPD = ReceiptDetailRow.Item("QTYSHPPD")

strUOFM = ReceiptDetailRow.Item("UOFM").ToString

fltUnitCost = ReceiptDetailRow.Item("UnitCost").ToString

intNonInven = ReceiptDetailRow.Item("NonInven").ToString

strLOCNCODE = ReceiptDetailRow.Item("LOCNCODE").ToString

strPONUMBER = ReceiptDetailRow.Item("PONUMBER").ToString

intINVINDX = ReceiptDetailRow.Item("INVINDX").ToString

strVENDNAME = ReceiptDetailRow.Item("VENDORID").ToString

intPOLNENUM = ReceiptDetailRow.Item("POLNENUM").ToString

strVNDITDSC = ReceiptDetailRow.Item("VNDITDSC").ToString

strITEMDESC = ReceiptDetailRow.Item("ITEMDESC").ToString

intItmTrKop = ReceiptDetailRow.Item("ItmTrKop").ToString

BuildOrderDetail(intCurrentLine)

If intItmTrKop = 2 Then

Dim ReceiptSerialAdapter As New dsReceivingsTableAdapters.ReceiptSerialNumbersTableAdapter

Dim ReceiptSerialTable As New dsReceivings.ReceiptSerialNumbersDataTable

Dim ReceiptFullSerialAdapter As New dsReceivingsTableAdapters.TPG10201TableAdapterDim ReceiptFullSerialTable As New dsReceivings.TPG10201DataTable

ReceiptSerialAdapter.FillBy(ReceiptSerialTable, strITEMNMBR, strPOPRCTNM)

intNumSerials = ReceiptSerialTable.Rows.Count - 1

If intNumSerials > -1 Then

ReDim SerialNumbers(intNumSerials)

Dim SERLTNUM As String = ""

Dim FullSerialNumber As String = ""

For Each SerialDetailRow As DataRow In ReceiptSerialTable.Rows

SERLTNUM = SerialDetailRow.Item("SERLTNUM").ToString

FullSerialNumber = SerialDetailRow.Item("FullSerialNumber").ToString

BuildSerialNumbers(strPOPRCTNM, strITEMNMBR, intCurrentLine, SERLTNUM)

ReceiptFullSerialAdapter.Insert(strITEMNMBR, SERLTNUM, FullSerialNumber)

Next

ReDim Preserve Receivings.taPopRcptSerialInsert_Items(intNumSerials)

Receivings.taPopRcptSerialInsert_Items = SerialNumbers

End If

End If

intCurrentLine = intCurrentLine + 1

Next

ReDim 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 data

ReceiptDetailAdapter.UpdateQuery(1, Date.Now, strErrDesc, Current.Session("UserName"), strPOPRCTNM)

Else

ReceiptDetailAdapter.UpdateQuery(0, Date.Now, strErrDesc, Current.Session("UserName"), strPOPRCTNM)End If

 

 

'End If

bolReceiptImportError = False

End If

Next

 

'reset counters

intReceiptSuccessCount = 0

intReceiptCurrentRow = 0

End Sub

 Kevin Vogler

Version: Unknown or N/A
Section: eConnect