cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting rows in a matrix

Former Member
0 Kudos

Hi

I am trying to select certain rows in a matrix, not a user defined one but an actual sbo one. I have tried using the omatrix.select method but vb gives me an error about the item is not a user defined item and cannot be manipulated in such a manner.

Anyone got any ideas please ?

Regards Andy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

This code contains your solution.

It iterates over each line in a SYSTEM matrix, and tests for a value in a column. If the value in the column is in a list, it will select that row by executing a 'Click' on the first column in the list.

It has multiple selection logic in it as well, as more than one row in the list may be valid.

NumberOfReceiptsFoundInMatrix = 0

For RowIndex = 1 To ReceiptMatrix.RowCount

Debug.Print ReceiptMatrix.Columns("DocNum").Cells(RowIndex).Specific.Value

If ExistsInCollection(CLng(ReceiptMatrix.Columns("DocNum").Cells(RowIndex).Specific.Value), ReceiptNumbers) = True Then

If NumberOfReceiptsFoundInMatrix = 0 Then

'

' Single select

'

Call ReceiptMatrix.Columns(1).Cells(RowIndex).Click(ct_Regular)

Else

'

' Multiple select for all further Receipts

'

Call ReceiptMatrix.Columns(1).Cells(RowIndex).Click(ct_Regular, mt_CTRL)

End If

'

' Track the number of Receipts that have been found, so the searching can stop once all

' the Receipts have been selected.

'

NumberOfReceiptsFoundInMatrix = NumberOfReceiptsFoundInMatrix + 1

End If

If NumberOfReceiptsFoundInMatrix = ReceiptNumbers.Count Then

'

' Break out of for loop early if all of the Receipts have been found.

'

Exit For

End If

Next RowIndex

Former Member
0 Kudos

Hi Demetree

Thats worked !, thanks alot for your suggestion

Regards Andy

Answers (1)

Answers (1)

rasmuswulff_jensen
Active Contributor
0 Kudos

Most system form have restrictions to what the SDK can do with them... But try clicking the grayed-out column in the system matrix... Most system matrices selcet rows that way....

Former Member
0 Kudos

Hi Rasmus

I have added a button and am clicking on that, I select certain rows if they belong to a certain warehouse. It's then I get a error message about the item not being user defined and cannot me manipulated in that maner.

I think it would work fine on a user defined matrix but not on a sap one

Regards Andy

Former Member
0 Kudos

There is the property SelectionMode for the Matix.

If this value equals 0, it's not possible to select a row.

Maybe on the matrix you want to select, this property is set to zero. You may try to change it to 1 on the load of the form , but that means you'd change the Business One logic.

Former Member
0 Kudos

Hi Sebastian

Just checked the value of selection mode and it is set to 3. I have just tried setting it to 1 and I get the same message as I get when I try to select a row.

Thanks for your input

Regards Andy

Former Member
0 Kudos

Can you tell me which form it is ?