📚 SAP Business One SDK Help

GeneralService Object
See Also  Members  Example

Description

The GeneralService provides access to UDOs.

With the service, you can add, look up and remove rows from user-defined tables. You can also invoke custom methods on the UDO's custom business implementation DLL.

Object Model








Example

See the documentation for the GeneralService methods AddCancel, Close, Delete, GetByParams, GetDataInterfaceFromXMLFile, GetDataInterfaceFromXMLString, GetList, InvokeMethod and Update for more code samples.
Using the GeneralService (Visual Basic)Copy Code
Dim oGeneralService As SAPbobsCOM.GeneralService
Dim oGeneralData As SAPbobsCOM.GeneralData
Dim oChild As SAPbobsCOM.GeneralData
Dim oChildren As SAPbobsCOM.GeneralDataCollection
Dim oGeneralParams As SAPbobsCOM.GeneralDataParams

'Get GeneralService (oCmpSrv is the CompanyService)
Set oGeneralService = oCmpSrv.GetGeneralService("MainUDO")

'Create data for new row in main UDO
Set oGeneralData = oGeneralService.GetDataInterface(gsGeneralData)
oGeneralData.SetProperty "Code", "First"
oGeneralData.SetProperty "U_Data", "my data"

'Create data for a row in the child table
Set oChildren = oGeneralData.Child("ChildUDO")
Set oChild = oChildren.Add
oChild.SetProperty "U_Data", "child data"
oChild.SetProperty "U_Type", 6

'Add the new row, including children, to database
oGeneralService.Add oGeneralData






Example

See Also