10-23-2017 8:12 PM - edited 02-04-2024 12:27 AM
Hi,
I’m currently using the SDK to read line items from SO. I add a button for an event I want to happen. Below is sample code. The problem I’m having when I call the RowCount method, it always gives me one even though the matrix haves more than one row. Do you know what I need to revise to have it return the correct number of rows?
If pVal.FormType = "139" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.ItemUID = "btnPO" And pVal.BeforeAction = True Then
Try
Dim oSOForm As SAPbouiCOM.Form
Dim oMatrix As SAPbouiCOM.Matrix
oSOForm = SBO_Application.Forms.Item(FormUID)
oMatrix = oSOForm.Items.Item(38).Specific
MsgBox("Total Rows:" + oMatrix.RowCount.ToString)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
Regards,
William
Hi William
There is a small mistake in your code in this line:
oMatrix = oSOForm.Items.Item(38).Specific
The correct is:
oMatrix = oSOForm.Items.Item("38").Specific
When you work with the items of the form you can retrieve them by two ways, by index or by Uid. In your case 38 is the Uid of the control that you want, then you need provide it as string.
Hope it clears.
Kind Regards,
Diego Lother
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.