📚 SAP Business One SDK Help

Add Method
See Also  Example
TableName
The table name for the data source

Description

Adds an item to the collection.

Syntax

Visual Basic
Public Function Add( _
   ByVal TableName As String _
) As DBDataSource

Parameters

TableName
The table name for the data source

Remarks

A table can only be associated with one data source on a form; otherwise, an exception is thrown.

Relevant for system forms only.

Example

Adding a DBDataSource (Visual Basic)Copy Code
Public Sub AddingDBDataSource()

    Dim oForm As SAPbouiCOM.Form
    Dim oDBDataSource As SAPbouiCOM.DBDataSource

    '// add a new form
    Set oForm = SBO_Application.Forms.Add("SampleForm")

    '// Add a DBDataSource to Bussines Partners table
    Set oDBDataSource = oForm.DataSources.DBDataSources.Add("OCRD")

End Sub

See Also