Skip to Content
Former Member
Mar 12, 2004 at 05:32 PM

DI: Add more than one serial numbers in Invoice


I have a problem when I try to invoice but of an item that is forced to select its series numbers. The first one item herself invoice well, the problem comes when in the same invoice I try to sell but of an item of this category, seems that not this taking correctly the itemcode.

When i tried add an invoice the next error shows myself:

[OSRI] , '[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'ItemCode', table 'SBODemo_US.dbo.OSRI'; column does not allow nulls. UPDATE fails.'

The following is part of code where I add my series numbers to my document lines

Set objSerial = RetrieveSerial(objDetail.ItemCode)

If objSerial.RecordCount > 0 Then

blnTruncate = True

For intQuantity = 1 To objDetail.Quantity

If intQuantity > 1 Then


objSerialNumbers.SetCurrentLine (intQuantity - 1)

End If

objSerialNumbers.BatchID = objSerial.Fields("U_XAMPBATC").Value

If objSerial.Fields("U_XAMPEXPD").Value <> "" Then

objSerialNumbers.ExpiryDate = CDate(objSerial.Fields("U_XAMPEXPD").Value)

End If

objSerialNumbers.InternalSerialNumber = objSerial.Fields("U_XAMPINTS").Value

objSerialNumbers.Location = objSerial.Fields("U_XAMPLOCA").Value

If objSerial.Fields("U_XAMPMAND").Value <> "" Then

objSerialNumbers.ManufactureDate = CDate(objSerial.Fields("U_XAMPMAND").Value)

End If

objSerialNumbers.ManufacturerSerialNumber = objSerial.Fields("U_XAMPMANS").Value

If objSerial.Fields("U_XAMPADMD").Value <> "" Then

objSerialNumbers.ReceptionDate = CDate(objSerial.Fields("U_XAMPADMD").Value)

End If

objSerialNumbers.SystemSerialNumber = objSerial.Fields("U_XAMPSYSS").Value

If objSerial.Fields("U_XAMPWARS").Value <> "" Then

objSerialNumbers.WarrantyEnd = CDate(objSerial.Fields("U_XAMPWARS").Value)

End If

If objSerial.Fields("U_XAMPWARE").Value <> "" Then

objSerialNumbers.WarrantyStart = CDate(objSerial.Fields("U_XAMPWARE").Value)

End If

objSerialNumbers.Notes = objSerial.Fields("U_XAMPNOTE").Value



End If

Thanks for the help...