📚 SAP Business One SDK Help

Update Method
See Also  Example
pIGeneralData
The data for the row to be updated. The GeneralData object must contain the key of the object to be updated.

Description

Updates an existing row in the database table of the current UDO.

The data for the row, including the key of the row to be updated, is contained in the GeneralData passed to the method.

Syntax

Visual Basic
Public Sub Update( _
   ByVal pIGeneralData As GeneralData _
) 

Parameters

pIGeneralData
The data for the row to be updated. The GeneralData object must contain the key of the object to be updated.

Example

Updating 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)

'Update UDO record
oGeneralData.SetProperty("U_Room", "2")
oGeneralData.SetProperty("U_Price", "40")
oGeneralData.SetProperty("U_Name", "Guy")
oGeneralService.Update(oGeneralData)

See Also