cancel
Showing results for 
Search instead for 
Did you mean: 

Problems adding context menus to each form

Former Member
0 Kudos

Hi,

I have some problems by adding a new MenuItem to a SBO Context menu.

I just try the following method:

With oMenuParam

.Checked = False

.Enabled = True

.Type = SAPbouiCOM.BoMenuType.mt_STRING

.UniqueID = "DWSEARCH"

.String = "Search for..."

End With

oForm.Menu.AddEx oMenuParam

I execute this code after FormLoad, the code add a new MenuItem, BUT... now my big problem:

when I click on the buttons in the toolbar to switch between different records of e.g. invoice, SBO removes the MenuItem from the ContextMenu.

When I watch into the object i can't find the menu. When I want to readd the menu, SBO says "Menu already exist"

Where is my fault? What can I do?

Thanks, Sebastian

Accepted Solutions (0)

Answers (1)

Answers (1)

FOA
Advisor
Advisor
0 Kudos

Hi Sebastian, it's not clear to me if you are trying to add a Menu exactly as the ones are showed in the main window of SAP B1. If this is the case you have to use type POPUP instead of String. You will have to add a node to the POPUP to make it visible.

Please check the sample "AddingMenuItems" delivered in the UI API folder under the Sap Business One SDK folder. Please put attention also at the position.

The menuitem was already entered in the Menu Collections of the application, even when you cant see it, this is why you are getting the message that the form already exist. In order to refresh the UI API you will have to reinitialize Business One.

Best Regards,

Felipe