📚 SAP Business One SDK Help

RemoveFromContent Method
See Also  Example

Description

Removes a menu item from the right-click menu.

The removal only affects the current right-click event. In subsequent right-click events, the item is displayed (unless this method is again called and the item is removed from the menu).

Syntax

Visual Basic
Public Sub RemoveFromContent( _
   ByVal menuId As Variant _
) 

Parameters

menuId
The unique ID of the menu item to remove

Remarks

You can call this method only during the right-click event's before notification. The method throws an exception when called from the after notification.

Example

(Visual Basic)Copy Code
Private Sub SBO_Application_RightClickEvent(ByRef contextMenuInfo As SAPbouiCOM.contextMenuInfo, ByRef BubbleEvent As Boolean) Handles SBO_Application.RightClickEvent
    If (contextMenuInfo.BeforeAction = True) Then

    'Only in before notification, remove menu using RemoveFromContent
    'No need to revert this action
    contextMenuInfo.RemoveFromContent("4870") 'Data->Filter & Grid

    End If
End Sub

See Also