📚 SAP Business One SDK Help

Add Method
See Also  Example
UID
The column unique ID
Type
The column type

Description

Adds a new column to the matrix.

Syntax

Visual Basic
Public Function Add( _
   ByVal UID As String, _
   ByVal Type As BoFormItemTypes _
) As Column

Parameters

UID
The column unique ID
Type
ValueDescription
it_BUTTONButton (not relevant for column type)
it_STATICStaticText  (not relevant for column type)
it_EDITEditText
it_FOLDERFolder (not relevant for column type)
it_RECTANGLEFrame (not relevant for column type)
it_COMBO_BOXComboBox
it_LINKED_BUTTONLinkedButton
it_PICTUREPictureBox
it_EXTEDITEditText with multiple lines
it_CHECK_BOXCheckBox
it_OPTION_BUTTONOptionBtn  (not relevant for column type)
it_MATRIXMatrix  (not relevant for column type)
it_GRIDGrid
it_PANE_COMBO_BOXPaneComboBox (not relevant for column type)
it_ACTIVE_XActiveX
it_BUTTON_COMBOButtonCombo (not relevant for column type)
it_WEB_BROWSERWebBrowser
The column type

Example

The following sample code shows how to add columns.
Adding Columns Example (Visual Basic)Copy Code
Public Sub AddingColumnsToMatrix()
    Dim oForm As SAPbouiCOM.Form

    Dim oMatrix As SAPbouiCOM.Matrix
    Dim oColumns As SAPbouiCOM.Columns
    Dim oColumn As SAPbouiCOM.Column

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

    '// Adding a Matrix item
    Set oMatrix = oForm.Items.Add("Matrix1", it_MATRIX)

    Set oColumns = oMatrix.Columns

    '// Adding Culomn items to the matrix

    Set oColumn = oColumns.Add("#", it_EDIT)
    oColumn.TitleObject.Caption = "#"

    Set oColumn = oColumns.Add("A", it_EDIT)
    oColumn.TitleObject.Caption = "A"

    Set oColumn = oColumns.Add("B", it_EDIT)
    oColumn.TitleObject.Caption = "B"

    Set oColumn = oColumns.Add("C", it_EDIT)
    oColumn.TitleObject.Caption = "C = A + B"
 End Sub
The following sample code shows how to add link arrow to column.
Adding Link Arrow (Visual Basic)Copy Code
Set oItem = oForm.Items.Add("Matrix1", it_MATRIX)

oItem.Left = 5
oItem.Width = 400
oItem.Top = 5
oItem.Height = 130

Set oMatrix = oItem.Specific
Set oColumns = oMatrix.Columns
Set oColumn = oColumns.Add("F", it_LINKED_BUTTON) '// new type of column
oColumn.TitleObject.Caption = "Linked to object"
oColumn.Width = 40
oColumn.Editable = True

Set oLink = oColumn.ExtendedObject '// new property
oLink.LinkedObject = lf_BusinessPartner

See Also