cancel
Showing results for 
Search instead for 
Did you mean: 

How to select registers?

Former Member
0 Kudos

I have one projecto with matrix seemed with the example demonstrated in C:\Program Files\SAP Manage\SAP Business One SDK\Samples\COM UI\VB.NET\06.MatrixAndDataSources\2003. I created a table, @PTSFCT, in SAP Business One.

I can bind to the table oDBDataSource = oForm.DataSources.DBDataSources.Add("@PTSFCT") and place all the values in matrix.

However, I would like to only select some data of the table using a Query.

For example: I would like to only show the registers of the table whose Num_Contrat is 1. How I must you make it?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Danilton,

You can approach this is one of two methods. You can either use a condition on your db data source (Look at conditions in the help file) or you can use a datatable and use a grid with that instead of a matrix. You can design the form in screenpainter. See below the code example.

            Dim oTable As SAPbouiCOM.DataTable
            Dim oGrid As SAPbouiCOM.Grid
            oGrid = oForm.Items.Item("m_BP").Specific
            oTable = oForm.DataSources.DataTables.Item(sTable)
            oGrid.DataTable = oTable
            oTable.ExecuteQuery(sQuery)

Hope it helps,

Adele

Answers (0)