📚 SAP Business One SDK Help

GetDataInterfaceFromXMLFile Method
See Also  Example
bstrFileName

Specifies the path and file name of the XML data.

Description

Creates a data structure from a specified XML file.

Syntax

Visual Basic
Public Function GetDataInterfaceFromXMLFile( _
   ByVal bstrFileName As String _
) As Object

Parameters

bstrFileName

Specifies the path and file name of the XML data.

Example

Shows how to get a Series from an XML file.
GetDataInterfaceFromXMLFile (Visual Basic)Copy Code
Dim oCmpSrv As SAPbobsCOM.CompanyService
Dim oSeriesService As SAPbobsCOM.SeriesService
Dim oSeries As Series
Dim oSeriesParams As SeriesParams
Dim oSeriesFromFile As Series

'get company service
oCmpSrv = oCompany.GetCompanyService

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

'get series params
oSeriesParams = oSeriesService.GetDataInterface(SeriesServiceDataInterfaces.ssdiSeriesParams)

'set the number of an existing series
oSeriesParams.Series = 5

'get the series
oSeries = oSeriesService.GetSeries(oSeriesParams)

'save series to file
oSeries.ToXMLFile("c:\MySeries.xml")

'create a new series data structure and fill it with the data from
'the xml file
oSeriesFromFile = oSeriesService.GetDataInterfaceFromXMLFile("c:\MySeries.xml")

See Also