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

Problems adding context menus to each form

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 23, 2005 at 12:43 PM

    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

    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.