cancel
Showing results for 
Search instead for 
Did you mean: 

DI: About Serial Numbers

Former Member
0 Kudos

Hello to the great forum of Business One from Mexico. I have a problem with the management of serial numbers, there are items that are forced to select the serial numbers at the moment to remove them from the stock. What parameters I need to send for the liberation of these articles on document lines (for example, of an Invoice), since this object has a property of series num. Any suggestion or help that you can give me, Thanks for your support.

Message was edited by: Frank Moebius

Hi Rafael,

Please use a prefix like "DI:" or "UI:" or "SBO:" etc. for the topic of your posts. This will help for a faster monitoring by other participants and - hopefully getting answers faster.

Thank you in advance,

Frank

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I have a similar situation with batches,

I would suggest going through the

document_line.SerialNumbers

when adding a document, populate the serealnumbers object at the same time as your line and it should do the trick

Former Member
0 Kudos

Dear Denis,

Already it had tried it and the same error sends me, in fact it command a valid parameter of a serial number in the detail of the document, but the same error occurs.

Anyway, thanks for your idea.

Former Member
0 Kudos

Post your code that you tryed adding a serrial number to an item.

Maybe you just misssing something.

Former Member
0 Kudos

This is part of the code to add serial numbers, objDetail is an object of Document_Lines. I use the method of series num to send him a string that contains the value of the serial number for the item.

Do While Not objRecordset.EOF

If intCount > 1 Then

objDetail.Add

End If

intCount = intCount + 1

objDetail.ItemCode = objRecordset.Fields("U_XAMPITCO").Value

objDetail.BarCode = objRecordset.Fields("U_XAMPITEA").Value

objDetail.ItemDescription = objRecordset.Fields("U_XAMPITDE").Value

objDetail.Quantity = objRecordset.Fields("U_XAMPITQU").Value

objDetail.Price = objRecordset.Fields("U_XAMPITPR").Value

objDetail.DiscountPercent = objRecordset.Fields("U_XAMPITDI").Value

objDetail.LineTotal = objRecordset.Fields("U_XAMPLINT").Value

'objDetail.SerialNum = "SN1"

objDetail.TaxCode = RetrieveTaxCode(objRecordset.Fields("U_XAMPITCO").Value)

objDetail.WarehouseCode = retrieveWareHouse

objRecordset.MoveNext

Loop

Former Member
0 Kudos

First thing , in case you didnt know, here is a little documentation you may not have read :

Order in which you add lines...

· Set properties on the header object (e.g. WorkOrders object)

· Set properties on the first line (WorkOrders_Lines object)

· Call Add method on line object to create a second line, then set properties on it.

· Now add the next line, set properties on it.

· Now add the next line, set properties on it.

· ... etc. DO NOT call ADD on after the last line. If you do, you will be adding a blank row and you'll get errors.

· When finished with all lines, call Add on the header object (WorkOrders object)

next

Look at the object structure for the Document_Line:

Object Model

Document_Line

|__SerialNumbers

|__ ManufacturerSerialNumber

|__ SystemSerialNumber

I'm not sure witch of these could work... (im gessing ManufacturerSerialNumber)

but your code should maybe look like this:

objDetail. ... 'Set all your Doc_Line properties first

'then...

objDetail.SerialNumbers.ManufacturerSerialNumber = "SN1"

Let me know

Former Member
0 Kudos

My object model is kinda distorted ....

hope you understand...

Document_Line.SerealNumbers.ManufacturerSerialNumber

Former Member
0 Kudos

Hello Denis,

Thanks for your help. I thought that property was of read only, since in the SBO Help comes from that form. Already with that I can advance. Obviously the code that send you so alone is a complete part of one more module than complies with the structure of the objects.

Thanks for all and I let you know when I complete the module.