cancel
Showing results for 
Search instead for 
Did you mean: 

Add new row Menu - right click Event

Former Member
0 Kudos

Hello everyone,

I am new in SAP Business One SDK and I am currently doing some tests with Matrix that I still cant get a solution, btw I am developing in VB.NET!

What I was trying to add or well activate is the Menu for a Matrix which I could enabled with this after the form I created is added to SAP collections

            _oForm.EnableMenu("1292", True)  'AddRow Menu

            _oForm.EnableMenu("1293", True)  'DeleteRow Menu

But when I click in deleterow it endeed deletes it but when I tried to add new row It does nothing, I am not sure why!!

So I would like some help with 2 things

1) How can I get the addrow to work?

2) How can I handle the event of both menus after action? Since Add new row, will just add the new row and i would have to set the number in the column, same goes to delete which just deletes it and I would have to reset all the matrix row number so they are all in order

Matrix is loaded with User Table info

Thanks

Appreaciate help

View Entire Topic
pedro_magueija
Active Contributor
0 Kudos

Hi Jean,

1) How can I get the addrow to work?

You have to add the row yourself. Unlike the delete which occurs automatically, you'll need to add the row to the matrix. There are several ways to do it. The recommended way would be to add a row to the datasource and load it from there. This will ensure the datasource is up-to-date with the matrix.

2) How can I handle the event of both menus after action? Since Add new row, will just add the new row and i would have to set the number in the column, same goes to delete which just deletes it and I would have to reset all the matrix row number so they are all in order

If you are handling both events, please note that you should prevent the auto delete that B1 executes. Otherwise the behavior will be strange. To do that capture the event mentioned by and make sure the BeforeAction is true (only for the delete menu). Then delete the row yourself and set the BubbleEvent to false (this prevents B1 from auto deleting the row).


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn
Follow @pedromagueija on Twitter