cancel
Showing results for 
Search instead for 
Did you mean: 

Create events for menus

former_member468525
Participant
0 Kudos

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?..

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

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

former_member468525
Participant
0 Kudos

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

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

former_member468525
Participant
0 Kudos

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.

paolo_fornari3
Participant
0 Kudos
Hi Jesus,

take a look at "Extension package tool".

it allows you to generate .ard files.

paolo_fornari3
Participant
former_member468525
Participant
0 Kudos

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

Answers (0)