📚 SAP Business One SDK Help

GetDocumentSeries Method
See Also  Example
pIDocumentTypeParams

Specified by the DocumentTypeParams identification key.

Description

Returns the SeriesCollection of all the Series that match a document identified by its DocumentTypeParams.

Syntax

Visual Basic
Public Function GetDocumentSeries( _
   ByVal pIDocumentTypeParams As DocumentTypeParams _
) As SeriesCollection

Parameters

pIDocumentTypeParams

Specified by the DocumentTypeParams identification key.

Example

GetDocumentSeries (.NET) (Visual Basic)Copy Code
Dim oCmpSrv As SAPbobsCOM.CompanyService
Dim oSeriesService As SAPbobsCOM.SeriesService
Dim oSeriesCollection As SeriesCollection
Dim oSeries As Series
Dim oDocumentTypeParams As DocumentTypeParams
Dim i As Integer

'get company service
oCmpSrv = oCompany.GetCompanyService

'get series service
oSeriesService = oCmpSrv.GetBusinessService(ServiceTypes.SeriesService)

'get series collection
oSeriesCollection = oSeriesService.GetDataInterface(SeriesServiceDataInterfaces.ssdiSeriesCollection)

'get Document Type Params
oDocumentTypeParams = oSeriesService.GetDataInterface(SeriesServiceDataInterfaces.ssdiDocumentTypeParams)

'set the document type
'(e.g. SaleInvoice=13 , BoObjectTypes has all document types)
oDocumentTypeParams.Document = 13

'get series collection
oSeriesCollection = oSeriesService.GetDocumentSeries(oDocumentTypeParams)

For i = 0 To oSeriesCollection.Count - 1

    'print the series name
    Debug.WriteLine(oSeries.Name)
    'print the series first number
    Debug.WriteLine(oSeries.InitialNumber)

Next

See Also