Skip to Content
author's profile photo Former Member
Former Member

Add new row Menu - right click Event

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Jun 23, 2016 at 07:05 AM

    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 @Edy Simon 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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 23, 2016 at 02:21 AM

    Hi,

    All menu events are handled in the BoEventTypes.et_MENU_CLICK event.

    Regards

    Edy

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 23, 2016 at 02:28 PM

    Thanks it workds I could handle the menu event like Edi said with SAPbouiCOM.BoEventTypes.et_MENU_CLICK but now I am facing another problem.

    How can I know what row was selected or where was it clicked?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.