on 02-18-2004 4:48 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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.
User | Count |
---|---|
104 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.