📚 SAP Business One SDK Help

GetColumnsPreferences Method
See Also  Example
pIColumnsPreferencesParams
Returns the data structure that specifies the identification key combination (user and form) of the Form Preferences.

Description

Retrieves the column preferences of a specified form for a specified user.

Syntax

Visual Basic
Public Function GetColumnsPreferences( _
   ByVal pIColumnsPreferencesParams As ColumnsPreferencesParams _
) As ColumnsPreferences

Parameters

pIColumnsPreferencesParams
Returns the data structure that specifies the identification key combination (user and form) of the Form Preferences.

Example

Shows how to get Columns Preferences from an XML file
GetDataInterfaceFromXMLFile (Visual Basic)Copy Code
Dim oCmpSrv As SAPbobsCOM.CompanyService
Dim oFormPreferencesService As FormPreferencesService
Dim oColsPreferences As ColumnsPreferences
Dim oColPreferencesParams As ColumnsPreferencesParams
Dim oColsPreferencesXmlFile As ColumnsPreferences

'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 xml file
oColsPreferences.ToXMLFile("c:\ColumnPreferences.xml")

'create Columns Preferences object from xml file
oColsPreferencesXmlFile = oFormPreferencesService.GetDataInterfaceFromXMLFile("c:\ColumnPreferences.xml")

Example

See Also