📚 SAP Business One SDK Help

GetDataInterfaceFromXMLString Method
See Also  Example
bstrXMLString
XML string.

Description

Creates a data structure from a specified XML string.

Syntax

Visual Basic
Public Function GetDataInterfaceFromXMLString( _
   ByVal bstrXMLString As String _
) As Object

Parameters

bstrXMLString
XML string.

Example

Shows how to get a Columns Preferences from an XML string
GetDataInterfaceFromXMLString (Visual Basic)Copy Code
Dim oCmpSrv As SAPbobsCOM.CompanyService
Dim oFormPreferencesService As FormPreferencesService
Dim oColsPreferences As ColumnsPreferences
Dim oColPreferencesParams As ColumnsPreferencesParams
Dim oColsPreferencesXmlStr As ColumnsPreferences
Dim sColsPreferencesStr As String

'get company service
oCmpSrv = oCompany.GetCompanyService

'get Form Preferences Service
oFormPreferencesService = oCmpSrv.GetBusinessService(ServiceTypes.FormPreferencesService)

'get Columns Preferences Params
oColPreferencesParams = oFormPreferencesService.GetDataInterface(FormPreferencesServiceDataInterfaces.fpsdiColumnsPreferencesParams)

'set the form id (e.g. A/R invoice=133)
oColPreferencesParams.FormID = "133"

'set the user id (e.g manager= 1)
oColPreferencesParams.User = 1

'get the Columns Preferences according to the formId & user id
oColsPreferences = oFormPreferencesService.GetColumnsPreferences(oColPreferencesParams)

'save Columns Preferences to string
sColsPreferencesStr = oColsPreferences.ToXMLString()

'create Columns Preferences object from string
oColsPreferencesXmlStr = oFormPreferencesService.GetDataInterfaceFromXMLString(sColsPreferencesStr)

See Also