Skip to Content
author's profile photo Former Member
Former Member

SBO_Application_ItemEvent not working

hi

i was trying to catch the event SBO_Application_ItemEvent for my UI test button. But when i click on Test button. this even is not beaing executing. SBO_Application is also Declared withevents

my code is as below

oItem = oForm.Items.Add("btnTest", SAPbouiCOM.BoFormItemTypes.it_BUTTON)

oItem.Left = 160

oItem.Width = 100

oItem.Top = 251

oItem.Height = 19

oButton = oItem.Specific

oButton.Caption = "Test"

Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent

If (pVal.FormUID = "MySimpleDBForm") Then

If ((pVal.ItemUID = "btnTest") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) And (pVal.Before_Action = False)) Then

SBO_Application.MessageBox("Event fired")

End If

End If

End Sub

can any body help me..what is the mistake in it. if this is not the correct way of capturing the events. then plz let me know the correct method

thanks in advance

regards

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 17, 2005 at 09:48 AM

    Hi,

    Try to use the

    C:\Programas\SAP Manage\SAP Business One SDK\Samples\Utility Projects\EventSpy to catch the event

    or

    use SBO_Application.SetStatusBarMessage(SBO_Application.Forms.ActiveForm.Mode.ToString + " - " + pVal.EventType.ToString + " - " + pVal.ItemUID + " - " + pVal.BeforeAction.ToString)

    to see in the statusbar the item UID.

    HTH,

    Ribeiro Santos

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 17, 2005 at 04:19 PM

    Try trapping on SAPbouiCOM.BoEventTypes.et_CLICK instead of pressed...

    Add a comment
    10|10000 characters needed characters exceeded

    • Regarding the original Problem:

      How do you create your form?

      Could you post the code?

      Regarding EventFilters:

      You might wish to check-out the information about event filters - unless you already did:

      - e.g. helpfiles here in SDN - still 6.5 here, but event filters did not change; to be found in the Developer Area for SAP Business One (SDK) on this site

      https://www.sdn.sap.com/sdn/developerareas/businessone.sdn?node=linkDnode10

      - or in your SDK Installation; usually:

      C:\Program Files\SAP Manage\SAP Business One SDK\Help

      - or on SAP Service Marketplace (you will find the SDK downloads inc. 2004 helpfiles around there):

      http://service.sap.com/smb/development/sdk

      - or got to "Education" section of the SMB Portal etc. you will find a lot of information there as well!!!

      http://service.sap.com/smb/education

      - or insist on being given the time to get trained.

      The helpfiles contain a section that deals with events and also shows you how to deal with event filters; the general prinicple is just that your Item eventhandler only gets called when an event occurs that you wish to receive...

      Please note that the information about a particular event has to cross two boundaries between processes (SAP B1 => UI API => Your Add-On) so that every event that does not have to be passed to your Add-On will improve it's performance!

      Just FYI: Breakpoints sometimes cause problems in the item event handler... when using .NET

      Regards

  • author's profile photo Former Member
    Former Member
    Posted on Feb 18, 2005 at 04:22 PM

    Does the "Trapping Events" example application run for you? If you are using v2004 and .net it is located in something like the following location:

    c:\Program Files\SAP Manage\SAP Business One SDK\Samples\COM UI\VB.NET\02.CatchingEvents

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.