cancel
Showing results for 
Search instead for 
Did you mean: 

Exception adding events

Former Member
0 Kudos
59

I'm trying to add a filter event to my own form:

Dim oFilters As SAPbouiCOM.EventFilters

Dim oFilter As SAPbouiCOM.EventFilter

oFilters = New EventFilters

oFilter=oFilters.Add(et_ITEM_PRESSED)

oFilter.Addex("MyForm")

SBO_Application.SetFilter(oFilters)

When I do the last instruccion, it gives me an exception "General Failure".

If I use the method oFilter.Add(200000010)(so i change de uid of my form), it doesn't gives me any exception, but i want to refer to my forms with strings, not with numbers.

Can anyone help me? Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Yes, i've done the SBO connection.

If i use oFilter.addex, gives me the exception when i do SBO_Application.SetFilter(oFilters)

If i use oFilter.add, all works ok, but i want to work with addex.

Former Member
0 Kudos

Hi Miguel,

You should not set the form uid, but the form type. Syntax is

Public Function AddEx(ByVal FormType As String) As FormType

<i>Parameters

FormType

A string specifying the form type you want to add.</i>

Hope this solves your problem,

Adele.

Answers (1)

Answers (1)

barend_morkel2
Active Contributor
0 Kudos

Question, have you done the full SBO connection of the SBO_Application variable before trying to add filters?


'1. UI Sign On
            '//Get the Connection String
            '1a. This is for Testing Purposes
            sConnectionString = "0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056"
            '1b. This is for Add-On Purposes 
            'sConnectionString = Environment.GetCommandLineArgs.GetValue(1)

            'Connect to a running SBO Application
            SboGuiApi = New SAPbouiCOM.SboGuiApi
            SboGuiApi.Connect(sConnectionString)

            'Get an initialized application object
            SBO_App = SboGuiApi.GetApplication()

'THEN
Dim oFilters As SAPbouiCOM.EventFilters
Dim oFilter As SAPbouiCOM.EventFilter

oFilters = New EventFilters
oFilter=oFilters.Add(et_ITEM_PRESSED)
oFilter.Addex("MyForm")
SBO_Application.SetFilter(oFilters)