cancel
Showing results for 
Search instead for 
Did you mean: 

Update serial number detail for serial numbers automatically added by SBO.

Former Member
0 Kudos

Hello All,

Using SAP Business One I have a stock item which is setup as follows :-

Manage by serial numbers

On Release Only

Automatic Serial Number Creation on Receipt

This basically creates blank serial numbers for any incoming quantity (i.e. goods receipt) done within SBO. For example I'd end up with a serial number with a System Serial Number of 1, but with no detail in Manufacturers or Internal Serial Number.

My issue is I need a way when my user issues the item out (say through a sales delivery) to amend the serial number detail, i.e. fill in the manufacturers and internal serial numbers.


Dim manSerialNumber As String
Dim maxSerial As Integer

manSerialNumber = "A_TEST_SERIAL_PREFIX"
maxSerial = 1        'As an example

For i = 0 To totalNumber - 1
    With oDelivery.Lines.SerialNumbers
        .SystemSerialNumber = CStr(maxSerial)
        .ManufacturerSerialNumber = manSerialNumber + "_" + CStr(i)
        .InternalSerialNumber = manSerialNumber + "_" + CStr(i)
        .SetCurrentLine(i)
        .Add()
    End With
Next

I would then go on to issue an oDelivery.Add() etc.

I've tried the preceding code in many guises, SetCurrentLine first and last, Add First and last all to no avail, any help would be greatly appreciated!

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

barend_morkel2
Active Contributor
0 Kudos

Hi Lee,

Try this:

For i = 0 To totalNumber - 1

With oDelivery.Lines.SerialNumbers

.SetCurrentLine(i)

.SystemSerialNumber = CStr(maxSerial)

.ManufacturerSerialNumber = manSerialNumber + "_" + CStr(i)

.InternalSerialNumber = manSerialNumber + "_" + CStr(i)

.Update()

End With

Next

Former Member
0 Kudos

Hi Barend,

There isn't a .Update associated with that object, I tried it before just incase it was a hidden method or something strange...but I get an exception, sorry I should've said.

Thanks.

Former Member
0 Kudos

You Update the object using the document object...

eg


Dim manSerialNumber As String
Dim maxSerial As Integer
 
manSerialNumber = "A_TEST_SERIAL_PREFIX"
maxSerial = 1        'As an example
 
For i = 0 To totalNumber - 1
    With oDelivery.Lines.SerialNumbers
        .SetCurrentLine(i)
        If i > 0 Then
            oDelivery.Lines.Add()
        End If
        .SystemSerialNumber = CStr(maxSerial)
        .ManufacturerSerialNumber = manSerialNumber + "_" + CStr(i)
        .InternalSerialNumber = manSerialNumber + "_" + CStr(i)
    End With
Next

oDelivery.Add()

Message was edited by: Daniel Archer

Message was edited by: Daniel Archer

Message was edited by: Daniel Archer

Former Member
0 Kudos

Daniel,

That's what I've explained in my example, I add the lines, then go on to add/update the entire document, however the serial numbers are not added/amended, there still seems to be no update to this thread. I've also tried the above scenario with 2005...Any help would be appreciated!

Am I going about this the wrong way? Can I only assign existing serial numbers when creating A/R Documents?

Thanks.

Lee.

Former Member
0 Kudos

Hi Lee,

I'm having the same problem here.

On Sales Delivery or A/R Inovice, the Serial Number must have had previously created.

Usint the application serial Numbers Management under Inventory menu, choosing the combo to "complete" option, you can create them.

But I have not figure out how to do this using SDK.

Have you find a solution for this ?

Former Member
0 Kudos

Anyone solved this problem?

Thanks 😃