📚 SAP Business One SDK Help

EventFilters Collection
See Also  Members  Example

Description

A collection of EventFilter objects.

By default, the UI API gets every event triggered by the SAP Business One application. Most of these events may not be useful to your add-on and handling all of them can hurt performance.

This object lets you filter the events your add-on receives and also specify the forms to which these filtered events apply.

Object Model


Remarks

For each event type you want to filter, create an event filter and add it to an EventFilters collection. Specify the collection in the Application.SetFilter method.

Use the EventFilter.AddEx of each event filter to specify form types on which the event type applies.

Example

Filtering Events (Visual Basic)Copy Code
oFilters As SAPbouiCOM.EventFilters
oFilter As SAPbouiCOM.EventFilter
Private Sub SetFilters()
    '// Create a new EventFilters object
    Set oFilters = New SAPbouiCOM.EventFilters

    '// Add an event type to the container
    '// This method returns an EventFilter object
    Set oFilter = oFilters.Add(et_CLICK)
    '// The form types to which the event will apply
    oFilter.AddEx 139 'Orders Form
    oFilter.AddEx 142 'Purchase Form

    Set oFilter = oFilters.Add(et_KEY_DOWN)
    '// Again the form type to which the event will apply
    oFilter.AddEx 139 'Orders Form

    SBO_Application.SetFilter oFilters
End Sub

See Also