📚 SAP Business One SDK Help

Query Method
See Also  Example
Conds
The condition for the query

Description

Runs the specified condition set query on the data source (table).

Syntax

Visual Basic
Public Sub Query( _
   Optional ByVal Conds As Conditions = 0 _
) 

Parameters

Conds
The condition for the query

Remarks

You cannot run this method on DBDataSource objects bounded to system forms.

Example

Querying a data source connected to a database table (Visual Basic)Copy Code
Public Sub QueryingDBDataSource()
    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 the Business Partners table
    Set oDBDataSource = oForm.DataSources.DBDataSources.Add("OCRD")

    '// Execute the query with the conditions collection
   oDBDataSource.Query
End Sub

See Also