📚 SAP Business One SDK Help

MenuEvent Object
See Also  Members  Example

Description

Represents a menu event in SAP Business One application (click on a menu item only). You use this object to interfere with SAP Business One process for this event.

Example

The following sample codes shows how to use the MenuEvent to catch events on menu items.
(Visual Basic)Copy Code
Private Sub SBO_Application_MenuEvent(pVal As SAPbouiCOM.IMenuEvent, BubbleEvent As Boolean)

'// Assuming the Application object was declared in the following manner
'// Public WithEvents SBO_Application As SAPbouiCOM.Application

    If pVal.BeforeAction = True Then

        SBO_Application.MessageBox _
        "Menu itme: " + pVal.MenuUID + " sent an event BEFORE SAP Business One processes it.", bmt_Long, True

        '// to stop SAP Business One from processing this event
        '// unmark the following statement

        '// BubbleEvent = False

    Else

        SBO_Application.MessageBox _
        "Menu itme: " & pVal.MenuUID & " sent an event AFTER SAP Business One processes it.", bmt_Long, True

    End If

End Sub

See Also