📚 SAP Business One SDK Help

SetBound Method
See Also  Example
Bound

Indicates whether to bind or unbind the item:

  • False: Unbind (default)
  • True: Bind
TableName

The name of a database table. For user data sources, leave this field empty.

Alias
  • For DBDataSource: The alias of a database field
  • For UserDataSource: The unique ID of the user data source 

Description

Binds an item to a data source.

Syntax

Visual Basic
Public Sub SetBound( _
   Optional ByVal Bound As Boolean = False, _
   Optional ByVal TableName As String = "", _
   Optional ByVal Alias As String = "" _
) 

Parameters

Bound

Indicates whether to bind or unbind the item:

  • False: Unbind (default)
  • True: Bind
TableName

The name of a database table. For user data sources, leave this field empty.

Alias
  • For DBDataSource: The alias of a database field
  • For UserDataSource: The unique ID of the user data source 

Remarks

This method is valid for user-defined items only.

Example

Binding a data source to an item (Visual Basic)Copy Code
Public Sub BimdingDataSourceToItem()

    Dim oForm As SAPbouiCOM.Form
    Dim oEditText As SAPbouiCOM.EditText

    '// Add a form
    Set oForm = SBO_Application.Forms.Add("SimpleForm")

    '// Add a UserDataSource to the form
    oForm.DataSources.UserDataSources.Add "EditSource", dt_SHORT_TEXT, 20

    '//*************************
    '// Adding a TextEdit item
    '//*************************

    Set oEditText = oForm.Items.Add("EditText1", it_EDIT).Specific

    '// Bind the text box to the UsedDataSource
    oEditText.DataBind.SetBound True, "", "EditSource"
End Sub

See Also