📚 SAP Business One SDK Help

MenuEvent Event
See Also  Example
pVal
The object that holds the event information
BubbleEvent

Indicates how the application handles the event. Relevant only when MenuEvent.BeforeAction is true.

  • True: The application handles the event after the current event handler is finished (default).
  • False: The application does not handle the event.
  • Description

    Occurs when a UI event (click) takes place on menu item in the SAP Business One application. 

    Syntax

    Visual Basic
    Public Event MenuEvent( _
       ByVal pVal As MenuEvent, _
       ByRef BubbleEvent As Boolean _
    )

    Parameters

    pVal
    The object that holds the event information
    BubbleEvent

    Indicates how the application handles the event. Relevant only when MenuEvent.BeforeAction is true.

  • True: The application handles the event after the current event handler is finished (default).
  • False: The application does not handle the event.
  • Example

    Catching menu events (Visual Basic)Copy Code
    Private Sub SBO_Application_MenuEvent(pVal As SAPbouiCOM.IMenuEvent, BubbleEvent As Boolean)

    '//********************************************************************************
    '// in order to activate your own forms instead of SAP Business One system forms
    '// process the menu event by yourself
    '// change BubbleEvent to False so that SAP Business One will not process it
    '//********************************************************************************

        If pVal.BeforeAction = True Then

            SBO_Application.SetStatusBarMessage _
            "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.SetStatusBarMessage _
            "Menu itme: " & pVal.MenuUID & " sent an event AFTER SAP Business One processes it.", bmt_Long, True

        End If

    End Sub

    See Also