📚 SAP Business One SDK Help

GetDefaultSeries Method
See Also  Example
pIDocumentTypeParams

Specified by the DocumentTypeParams identification key.

Description

Return the default Series object for a document identified by its DocumentTypeParams.

Syntax

Visual Basic
Public Function GetDefaultSeries( _
   ByVal pIDocumentTypeParams As DocumentTypeParams _
) As Series

Parameters

pIDocumentTypeParams

Specified by the DocumentTypeParams identification key.

Example

The following is a VB.NET sample that retrieves the default series of a specified document type.
GetDefaultSeries (Visual Basic)Copy Code
Dim oCmpSrv As SAPbobsCOM.CompanyService
Dim oSeriesService As SAPbobsCOM.SeriesService
Dim oSeries As Series
Dim oDocumentTypeParams As DocumentTypeParams

'get company service
oCmpSrv = oCompany.GetCompanyService

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

'get new series
oSeries = oSeriesService.GetDataInterface(SeriesServiceDataInterfaces.ssdiSeries)

'get DocumentTypeParams for filling the document type
oDocumentTypeParams = oSeriesService.GetDataInterface(SeriesServiceDataInterfaces.ssdiDocumentTypeParams)

'set the document type (e.g. A/R Invoice=13)
oDocumentTypeParams.Document = 13

'get the default series of the SaleOrder documentset the document type
oSeries = oSeriesService.GetDefaultSeries(oDocumentTypeParams)

'print the default series name
Debug.WriteLine(oSeries.Name)

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

See Also