📚 SAP Business One SDK Help

Add Method
See Also  Example
UID
An ID for the user data source. The ID must be unique within the collection.
DataType
The data type of the data source
Length

A long integer specifying how many characters are valid in the item connected to this data source.

Relevant for data type dt_SHORT_TEXT only.

Description

Adds an item to the collection.

Syntax

Visual Basic
Public Function Add( _
   ByVal UID As String, _
   ByVal DataType As BoDataType, _
   Optional ByVal Length As Long = 254 _
) As UserDataSource

Parameters

UID
An ID for the user data source. The ID must be unique within the collection.
DataType
ValueDescription
dt_LONG_NUMBERLong number
dt_SHORT_NUMBERShort number
dt_QUANTITYQuantity
dt_PRICEPrice
dt_RATERate
dt_MEASUREMeasure
dt_SUMSum
dt_PERCENTPercent
dt_LONG_TEXTLong text
dt_SHORT_TEXTShort text
dt_DATEDate
The data type of the data source
Length

A long integer specifying how many characters are valid in the item connected to this data source.

Relevant for data type dt_SHORT_TEXT only.

Return Type

The new user data source

Example

Adding a user data source (Visual Basic)Copy Code
Public Sub AddingUserDataSource()

    Dim oForm As SAPbouiCOM.Form
    Dim oUserDataSource As SAPbouiCOM.UserDataSource

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

    '// Add a user data source to the form
    oForm.DataSources.UserDataSources.Add "UserSource", dt_SHORT_TEXT, 20

End Sub

See Also