cancel
Showing results for 
Search instead for 
Did you mean: 

Get LineNum (RDR1) of selected matrix row

Former Member
0 Kudos

Hi there,

can someone help me ?

I need to know the (RDR1) LineNum of the actual selected

matrix row in SBO Sales Orders.

The matrix contains item rows, textual rows and a subtotoal row.

How can i read this LineNum over the SBO-SDK ?

Thanks Thomas

Accepted Solutions (1)

Accepted Solutions (1)

AlexGrebennikov
Active Contributor
0 Kudos

Hi Thomas!

Here is a syntax of ItemEvent Event:

Public Event ItemEvent( _
   ByVal FormUID As String, _
   ByVal <b>pVal As ItemEvent</b>, _
   ByRef BubbleEvent As Boolean _
)

All you need is to catch needed event and then read Row-property of pVal object. It'll give you rowNumber.

Former Member
0 Kudos

Hi Alexey,

many thanks for reply but, sorry, your explanation does

not solve my specific problem.

Reasons

1) i could not catch the event in my function, i have to

use Matrix.GetNextSelectedRow(FirstRow:=0) ....

2)

if the user deletes some rows in the

matrix, the underlying LineNum of the remaining

rows are retained.

So it could be, that LineNum (RDR1) of the first

visible Row (RowNum=1) is 5.

Thats the problem. I need a link from the (Visible) Row

number to the RDR1 LineNum.

rgds Thomas

FOA
Advisor
Advisor
0 Kudos

Hi Thomas,

I agree with Alexey that you can use pval.row to get the the line that is in focus. Check it by yourself by executing the EventSpy (C:\Program Files\SAP Manage\SAP Business One SDK\Samples\Utility Projects\EventSpy).

Check the "Row" column, it's always giving the correct number.

In case of trees you can get this problem, but in 2005 is solved by a new property in the Matrix object called "VisualRowCount"

HTH,

Felipe

Former Member
0 Kudos

Hi Felipe,

i think there's a little confusion about my question,

maybe i did not exactly worded it.

I agree with you and Alexey, that pVal.Row gets the line

that is in focus.

But this information does not mean very much

to me in this case, because its not unique.

I have to save a pointer to the selected matrix row in

our AddOn table, to access the DocumentLine in a later session.

Maybe three days later, i have to do some queries and

then, i have to know which DocumentLine was selected.

For this requirement, the pVal.Row is not usable,

because, for my oppinion, the pVal.Row is a temporary

row number for displaying the RDR1 Lines.

(Note: the user can add or remove rows)

I've made a workaround, to get the LineNum over

RDR1.VisOrder, but if there are some textlines or

subtotal lines in the matrix, this doesn't work easily.

The informations are splitted into RDR1 ond RDR10.

My question is, does SBO-SDK exposes a function, that

get's me RDR1.LineNum of selected matrix row, or

do i have to make a workaround over RDR1 + RDR10 ?

rgds Thomas

Former Member
0 Kudos

HI

What if you add a column to your matrix that is connected to rdr1.linenum and sets his width to zero making it invisible, when you take the selected row read the value of the column rdr1.linenum of the row selected and then you have the real linenum (i hope, i haven't tried it).

maybe this help you

Luck

Kind Regards

Salvador Biot

Message was edited by: Salvador Biot

Former Member
0 Kudos

Hi Salvador,

good Idea, i will check it, if its usable.

rgds Thomas

Answers (0)