Site Search:
Sign in | Join | Help

Receiving with Serial Numbers

Last post 05-13-2008 11:30 AM by kvogler. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 05-12-2008 4:02 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

    • 76.249.253.230
  • 05-12-2008 5:21 PM In reply to

    Re: Receiving with Serial Numbers

    Kevin:

    I'm happy to help, but I don't have time to look through all the code above and spot the issue. Can you please post the XML doc that is being sent to Dynamics? One document only, please, make it easy on me.

    If you don't know how to get the doc let me know and I'll point you.

    POPRCTNM, ITEMNMBR, SERLTNUM, and RCPTLNNM are all required fields. Are you providing them? If multibin is enabled, then the BIN field is probably required too.

     

    Steve Gray, MCDBA
    Technical Editor
    steve@VSToolsForum.com
    • 71.100.135.32
  • 05-12-2008 5:32 PM In reply to

    Re: Receiving with Serial Numbers

    Thanks for the quick response. Here's the XML

     

    <eConnect xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    - <POPReceivingsType>
      <eConnectProcessInfo xsi:nil="true" />
      <taRequesterTrxDisabler_Items xsi:nil="true" />
      <taUpdateCreateItemRcd xsi:nil="true" />
      <taUpdateCreateVendorRcd xsi:nil="true" />
      <taCreateVendorAddress_Items xsi:nil="true" />
      <taPopRcptLotInsert_Items xsi:nil="true" />
    - <taPopRcptSerialInsert_Items>
    - <taPopRcptSerialInsert>
      <POPRCTNM>REC_001693_25</POPRCTNM>
      <ITEMNMBR>PP1000SE PCI</ITEMNMBR>
      <SERLTNUM>100012155633256</SERLTNUM>
      <RCPTLNNM>0</RCPTLNNM>
      </taPopRcptSerialInsert>
      </taPopRcptSerialInsert_Items>
    - <taPopRcptLineInsert_Items>
    - <taPopRcptLineInsert>
      <POPTYPE>1</POPTYPE>
      <POPRCTNM>REC_001693_25</POPRCTNM>
      <PONUMBER>PO001256</PONUMBER>
      <ITEMNMBR>PP1000SE PCI</ITEMNMBR>
      <ITEMDESC>PP1000se PCI p/n P003-180-02</ITEMDESC>
      <VENDORID>VERIFONE</VENDORID>
      <VNDITNUM>PP1000SE PCI</VNDITNUM>
      <VNDITDSC>PP1000se PCI p/n P003-180-02</VNDITDSC>
      <ACTLSHIP>1900-01-01 00:00:00.000</ACTLSHIP>
      <INVINDX>13</INVINDX>
      <QTYSHPPD>1</QTYSHPPD>
      <AUTOCOST>1</AUTOCOST>
      <LOCNCODE>MAIN</LOCNCODE>
      <POLNENUM>507904</POLNENUM>
      <receiptdate>1900-01-01 00:00:00.000</receiptdate>
      </taPopRcptLineInsert>
      </taPopRcptLineInsert_Items>
      <taPopRcptMultiBin_Items xsi:nil="true" />
      <taPopRcptLineTaxInsert_Items xsi:nil="true" />
      <taPopRctUserDefined xsi:nil="true" />
      <taPopDistribution_Items xsi:nil="true" />
      <taAnalyticsDistribution_Items xsi:nil="true" />
    - <taPopRcptHdrInsert>
      <POPRCTNM>REC_001693_25</POPRCTNM>
      <POPTYPE>1</POPTYPE>
      <VNDDOCNM>None</VNDDOCNM>
      <receiptdate>5/12/2008</receiptdate>
      <ACTLSHIP>1900-01-01 00:00:00.000</ACTLSHIP>
      <BACHNUMB>BAC_001626</BACHNUMB>
      <VENDORID>VERIFONE</VENDORID>
      <VENDNAME>VERIFONE</VENDNAME>
      <Tax_Date>5/12/2008</Tax_Date>
      <TIME1>1900-01-01 00:00:00.000</TIME1>
      <AUTOCOST>1</AUTOCOST>
      <EXPNDATE>1900-01-01 00:00:00.000</EXPNDATE>
      <EXCHDATE>1900-01-01 00:00:00.000</EXCHDATE>
      <RATEEXPR>0</RATEEXPR>
      <DYSTINCR>0</DYSTINCR>
      </taPopRcptHdrInsert>
      <taMdaUpdate_Items xsi:nil="true" />
      </POPReceivingsType>
      </eConnect>
    • 76.249.253.230
  • 05-13-2008 8:59 AM In reply to

    Re: Receiving with Serial Numbers

    ahhh, Kevin-san. It all becomes clear... <cheesy chinese accent>

    In the taPopRcptSerialInsert node, you have a RCPTLNNM = 0, in the taPopRcptLineInsert node you don't have a RCPTLNNM. You're assuming that ITEMNMBR will link the lines. It is techically possible to have a PO with two lines with the same ITEMNMR, and have a receipt with two lines with the same ITEMNMBR. So, if you want to have a serial node, you need to specify matching line number for the line and the serial.

     

    Steve Gray, MCDBA
    Technical Editor
    steve@VSToolsForum.com
    • 74.1.246.98
  • 05-13-2008 9:28 AM In reply to

    Re: Receiving with Serial Numbers

    Thanks for the reply Steve. I thought about that also. In the code, I am passing the same RECPTLNNM value for the line insert but it doesn’t appear in the xml. Any suggestions as to why that value doesn’t show?

    Here's the code:

    ReceiptLine = New taPopRcptLineInsert_ItemsTaPopRcptLineInsert

    'Populate the elements of the first Receipt line

    LineItems(LineNumber) = ReceiptLine

    With LineItems(LineNumber)

    .POPTYPE = 1

    .POPRCTNM = strPOPRCTNM

    .PONUMBER = strPONUMBER

    .ITEMNMBR = strITEMNMBR

    .ITEMDESC = strITEMDESC

    .VENDORID = strVENDORID

    .RCPTLNNM = LineNumber

    .VNDITNUM = strVNDITNUM

    .VNDITDSC = strVNDITDSC

    .ACTLSHIP = "1900-01-01 00:00:00.000"

    .INVINDX = 13

    If .PONUMBER = "" Then .UOFM = strUOFM

    .UNITCOST = fltUnitCost

    .EXTDCOST = 0

    .NONINVEN = intNonInven

    .JOBNUMBR = ""

    .BOLPRONUMBER = ""

    .QTYSHPPD = intQTYSHPPD

    .QTYINVCD = 0

    .AUTOCOST = 1

    .Purchase_IV_Item_Taxable = 2

    .Purchase_Item_Tax_Schedu = ""

    .Purchase_Site_Tax_Schedu = ""

    .TAXAMNT = 0

    .Landed_Cost_Group_ID = ""

    .LOCNCODE = "MAIN"

    .POLNENUM = intPOLNENUM

    .receiptdate = "1900-01-01 00:00:00.000"

    .CURNCYID = ""

    .ProjNum = ""

    .CostCatID = ""

    .AutoAssignBin = 1

    .RequesterTrx = 0

    .USRDEFND1 = ""

    .USRDEFND2 = ""

    .USRDEFND3 = ""

    .USRDEFND4 = ""

    .USRDEFND5 = ""

    • 76.249.253.230
  • 05-13-2008 10:59 AM In reply to

    Re: Receiving with Serial Numbers

    In your XML above, the RECPTLNNM in the serial line is 0. Make it 16384. In your code above, I see where your are assigning RECPTLNNM but I can't see the value. If it's zero, maybe that's the prob. Anyway, explicitly assign 16384, and then if there are multiple lines increment by 16384. Don't ask why <smiles>

     

    Steve Gray, MCDBA
    Technical Editor
    steve@VSToolsForum.com
    • 71.100.135.32
  • 05-13-2008 11:30 AM In reply to

    Re: Receiving with Serial Numbers

    Thanks Steve,

    16384? Did I miss this in the documentation? Anyway, that did the trick and allowed me to see all of my own code errors more clearly. I was just assigning the actual line number of the receipt (0,1,2,3).

     Thanks again for all of your sage help

    Kevin Vogler
    Phoenix Group

    • 76.249.253.230
Page 1 of 1 (7 items)