📚 SAP Business One SDK Help

GetDICompany Method
See Also  Example

Description

Returns the DI company object.

Use this method to reduce memory consumption when running multiple DI API add-ons. For more information, see Improve Add-On Performance.

Syntax

Visual Basic
Public Function GetDICompany() As Object

Remarks

Connection to the DI API with this method supports only the latest DI API version. Side-by-side connection is not supported.

Example

Accessing DI Company object (Visual Basic)Copy Code
SboGuiApi = New SAPbouiCOM.SboGuiApi
'// Connect to a running SBO Application
If connectionString = "" Then
    If Environment.GetCommandLineArgs().Length = 1 Then
        sConnectionString = "0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056"
    Else
        sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
    End If
Else
    '//Connection string was filled before
End If

SboGuiApi.Connect(sConnectionString)
SBO_Application = SboGuiApi.GetApplication()

'// Get DI company via multiple addon (via UI)
Dim oCompany As SAPbobsCOM.Company
oCompany = SBO_Application.Company.GetDICompany()

'// No need to connect

See Also