06-21-2017 9:06 AM - edited 02-03-2024 9:47 PM
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?..
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also take a look at this Ankit blog post.
https://blogs.sap.com/2014/01/28/creating-an-add-on-registration-data-ard-file-in-sap-b1/
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.