cancel
Showing results for 
Search instead for 
Did you mean: 

matrix row delete event

Former Member
0 Kudos

Deal all,

I added a control to calculate the matrix row total in a SAP-B1 system form, i need to refresh when user delete a matrix row , but I don't know the delete trigger event.

pls help.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

thanks for your reply.

I put it in MenuEvent, and it is triggered when I right-click "delete".

But would you please advise how can I check the current FormType under MenuEvent ?

I want this event trigger in a specific form only.

Thanks

Former Member
0 Kudos

Hi HKCM,

in menu event before action false write this code

If pVal.MenuUID = "1293" Then

If objForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Or objForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE Then

For intCurrentRow As Integer = 1 To objMatrix.VisualRowCount

objMatrix.Columns.Item("V_-1").Cells.Item(intCurrentRow).Specific.Value = intCurrentRow

Next

End If

and the row count as visualrowcount

and replace the itemevent before actions false rowcounts as visualrowcount

Rgds

Micheal

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Michael,

there is no problem now.

your code is very helpful.

thanks again.

Former Member
0 Kudos

Hi, Micheal

thank you very much for your reply.

i know how to catch the event for specific ftorm, but i can't catch your meaning about

"and the row count as visualrowcount

and replace the itemevent before actions false rowcounts as visualrowcount"

here is my code:

If pVal.MenuUID = "1293" And pVal.BeforeAction = False Then

If oForm.Type = "141" And (oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Or oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE) Then

For i As Integer = 1 To oMatrix.VisualRowCount

      • sum up the line total here .....

next i

end if

end if

my problem is, there is total 4 rows in the matrix, after i delete 1 row, oMatrix.VisualRowCount still returns 4, how can i calculate the line total by ignoring the deleted row ?

thanks

Former Member
0 Kudos

Hi,

i cant get u.what u mean to say is if u have 4 rows and u delete one row then it automaticaly becomes 3 and the next row would be anull one as ur writing the update loop in menu event

Rgds

Micheal

Former Member
0 Kudos

Hi hkcm,

You need to catch the form's 1293 menu event.

Regards,

Vítor Vieira