Showing results for 
Search instead for 
Did you mean: 

Retrieving Batch Numbers

Former Member
0 Kudos


Is it possible to retrieve the valid BatchNumbers for an ItemCode via DI - Business Object somehow?



Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos


Seems that Batchnumbers/Serialnumbers are not implemented in DI API (At least retrieving functions and production order related stuff)

Will use recordset - object once again

Former Member
0 Kudos


Can anyone tell me when the SerialNumbers/BatchNumbers objects will be correctly implemented on DI API. From what I can see the SerialNumbers object exists, but is not recognized be "getbusinessobject" - a bit useless!

Also in March 2005 I read somewhere the the Worksorder / Production order (the new one) will be implemented in DI API soon as the current one references the wrong table all together...

Any news?


Former Member
0 Kudos

Hi all:

About the production object in Di, Probably it will be implemented in the Jule patch, many partner's are waiting in order to develop their solutions with the production order's.

And about the Batch Numbers object, it works fine the only problem I have seen is that, it doesn't set the item desciption, and we can's update o use some method's.

for example in an oPurchaseDeliveryNotes


VPurchaseDeliveryNotes.Lines.BatchNumbers.BatchNumber = "BatcNumber"

VPurchaseDeliveryNotes.Lines.BatchNumbers.Quantity = "Quantity"



Former Member
0 Kudos

Hi Thank You,

How do I co about finding out exactly when the production order patch will be released?

Further about the batch number: I must admit that I didn't look at the batch number object at all but only the serial number one and asumed the problem is the same. I cannot get the DI API to work with the serial numbers object. I am trying to create serial numbers for items with serial numbers on release only...



Former Member
0 Kudos

Hi Jermo:

In fact there is no way to know the time of the implementation, I have recieved the news speaking with my Sap support in Ireland.

And about the BatchNumbers object the problem that I have seen is what I told you in the last post, He doesn't add the item description at creating Batche's, may be in the serial number you have also the same problem.

they have to solve the problem and complete the process.

0 Kudos

Hi Philipp,

Please check object BatchNumbers in the DI API help. This object contains several properties to handle Batch numbers.

For additional info you can check the "4.SerialAndBatch" sample. You will find it under the "Sap Business One SDK" folder--> Samples --> COM DI --> 4.SerialAndBatch



Former Member
0 Kudos

Hi Felipe

Thanks for the hint. I tried to solve it with the BatchNumbers - Object first but I didn't found any retrieving functions.

What I want is to lookup valid batch numbers/quantities for an given article (imho a pretty common usecase).

Imho it would be natural to retrieve the list via Items - Object. But since I didn't found the BatchNumbers Collection there i tried with GenInventoryEntry which has this property:

    Public Function getBatchNumbers(ByVal strItemCode As String) As Long
        Dim oWEntry As SAPbobsCOM.Documents
        Dim oRs As SAPbobsCOM.Recordset
        Dim strIC As String
        Dim i As Long
        Dim ii As Long
        oWEntry = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenEntry)
        oRs = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
        oRs.DoQuery("SELECT OIGN.DocEntry  FROM OIGN  INNER JOIN IGN1 ON OIGN.DocEntry = IGN1.DocEntry WHERE IGN1.ItemCode='" & strItemCode & "'")
        oWEntry.Browser.Recordset = oRs
        Do While oWEntry.Browser.EoF = False
            For i = 0 To oWEntry.Lines.Count - 1
                strIC = oWEntry.Lines.ItemCode
                If strIC = strItemCode Then
                    For ii = 0 To oWEntry.Lines.BatchNumbers.Count - 1
                    Next ii
                End If
            Next i
    End Function

I've tested with an ItemCode that has a BatchNumber with Quantities behind it.

But it always displays an Empty - String so I assume this Object doesn't get properly filled or is only for writing - purposes or I'm doing something completely wrong here (I think this approach is pretty cumbersome)

Can somebody confirm that?

Thanks Philipp

Former Member
0 Kudos


sorry but I don't understand where to find this example.



For additional info you can check the "4.SerialAndBatch" sample. You will find it under the "Sap Business One SDK" folder--> Samples --> COM DI --> 4.SerialAndBatch



Best regards

Thank you

Former Member
0 Kudos

You've got mail

It seems that some samples get overwritten when updating b1.