Skip to Content
0

Create events for menus

Jun 21, 2017 at 08:06 AM

70

avatar image

I have the following code

public static void AddMenus() {

AddMenuItem(SAPbouiCOM.BoMenuType.mt_POPUP, 15, "My Module", "MyMenu", "43520");

AddMenuItem(SAPbouiCOM.BoMenuType.mt_STRING, -1, "Maintain Master", "MySubMenu", "MyMenu");

AddMenuItem(SAPbouiCOM.BoMenuType.mt_POPUP, -1, "Maintain Transactions", "MySubMenu0", "MyMenu");

AddMenuItem(SAPbouiCOM.BoMenuType.mt_STRING, -1, "Maintain Transactions_1", "MyMenu2_1", "MySubMenu0");

AddMenuItem(SAPbouiCOM.BoMenuType.mt_STRING, -1, "Maintain Transactions_2", "MyMenu2_2", "MySubMenu0");

AddMenuItem(SAPbouiCOM.BoMenuType.mt_STRING, -1, "Maintain Transactions_3", "MyMenu2_3", "MySubMenu0");

}

public static void AddMenuItem(SAPbouiCOM.BoMenuType boMenuType, int Position, String String, String UID, String Parent) {

if (SBO_Application.Menus.Exists(UID)) {

return; }

SAPbouiCOM.MenuCreationParams oCreParams = (SAPbouiCOM.MenuCreationParams)SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams);

oCreParams.Type = boMenuType; oCreParams.Position = Position; oCreParams.String = String;

oCreParams.UniqueID = UID;

SBO_Application.Menus.Item(Parent).SubMenus.AddEx(oCreParams);

}

I need to create events for the menu, how can I do it?..

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
ANKIT CHAUHAN
Jun 21, 2017 at 10:05 AM
1

Hi Jesus,

Refer to the UI sample code from the following location:

C:\Program Files (x86)\sap\SAP Business One SDK\Samples\COM UI\CSharp\02.CatchingEvents

It can be used as below:

SBO_Application.MenuEvent += new SAPbouiCOM._IApplicationEvents_MenuEventEventHandler( SBO_Application_MenuEvent );

Kind regards,

ANKIT CHAUHAN

SAP SME Support

Show 6 Share
10 |10000 characters needed characters left characters exceeded

excellent thank you very much,

I have another doubt, already create the menu and I have the event, How do I make it in the installed sap

0
Hi Jesus,

take a look at "Extension package tool".

it allows you to generate .ard files.

pglcf.png (49.7 kB)
0
0

Hi, thank you very much for the information, I'll put it into practice right now.

0

Hi Jesus,

For that, you need to create an Add-On Registration Data File (ARD) file and install your add-on in SAP Business One.

Kind regards,

ANKIT CHAUHAN

SAP SME Support

0

yes.! I was investigating, but I can not find information that explains me well. You will have some kind of documentation or I could also explain to create the add-ons and install it.

Thank you very much for the help.

0