📚 SAP Business One SDK Help

GetByParams Method
See Also  Example
pIGeneralDataParams

Contains a property whose value is the key of the row to return.

For example, for a UDO for a master data table, the object contains a property called Code whose value is the key of the row to return.

Description

Gets a row from the database table of the current UDO.

The row is specified by passing its key to the method.

Syntax

Visual Basic
Public Function GetByParams( _
   ByVal pIGeneralDataParams As GeneralDataParams _
) As GeneralData

Parameters

pIGeneralDataParams

Contains a property whose value is the key of the row to return.

For example, for a UDO for a master data table, the object contains a property called Code whose value is the key of the row to return.

Return Type

The data for the returned row.

Example

Getting a UDO record (Visual Basic)Copy Code
Dim oGeneralService As SAPbobsCOM.GeneralService
Dim oGeneralData As SAPbobsCOM.GeneralData
Dim oGeneralParams As SAPbobsCOM.GeneralDataParams

Dim sCmp As SAPbobsCOM.CompanyService
sCmp = oCompany.GetCompanyService

'Get a handle to the SM_MOR UDO
oGeneralService = sCmp.GetGeneralService("SM_MOR")

'Get UDO record
oGeneralParams = oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams)
oGeneralParams.SetProperty("DocEntry", "2")
oGeneralData = oGeneralService.GetByParams(oGeneralParams)

See Also