📚 SAP Business One SDK Help

GroupWith Method
See Also  Example
TargetUID
The unique ID of the existing folder with which you want to group this folder

Description

Groups a folder with another folder.

Use this method to indicate to the form to display one folder at a time from among the group of folders.

Syntax

Visual Basic
Public Sub GroupWith( _
   ByVal TargetUID As String _
) 

Parameters

TargetUID
The unique ID of the existing folder with which you want to group this folder

Remarks

When calling this method, SAP Business One automatically arranges the ValOn property of the items in the group. The property is set in increasing order, starting with 1.

Example

Grouping folders (Visual Basic)Copy Code
Public Sub UsingFolderGroupWith()
    Dim oForm As SAPbouiCOM.Form
    Dim oFolder As SAPbouiCOM.Folder

    Dim i As Integer '// to be used as a counter

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

    '//***************************
    '// Adding Folder items
    '//***************************
    For i = 1 To 3

        Set oFolder = oForm.Items.Add("Folder" & i, it_FOLDER).Specific

        '// set the caption
        oFolder.Caption = "Folder" & i
        oFolder.DataBind.SetBound True, "", "FolderDS"

        If Not i = 1 Then
            '// Grouping the folders
            oFolder.GroupWith ("Folder" & i - 1)
        End If
    Next i
End Sub

See Also