on 09-18-2008 6:51 AM
I have created a simple vb project using VB B1 AddOn Wizard and i add a form using screen painter.I have added listeners for buttons.After run the application new menu is appearing and pop up the form,but the button events are not working (
<B1Listener(BoEventTypes.et_CLICK, false)> _
Public Overridable Sub OnAfterClick(ByVal pVal As ItemEvent)
Dim ActionSuccess As Boolean = pVal.ActionSuccess
Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)
Dim item As Item = form.Items.Item("1")
Dim button As Button = CType(item.Specific,Button)
'ADD YOUR ACTION CODE HERE ...
End Sub
) ,this code is not working when the button is clicked.
Please help me
Hi,
maybe you should look if you enabled this Event in the EventFilter.
i don't use this Wizard and so iam not sure if EventFilters are included in this template.
in the Filter you enable each event for a given Form or all Forms.
just check it
lg David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Satyapal,
There are very helpful sample projects provided by SAP for getting users started with the SDK coding.
For the functioanlity which you are trying to achieve I would suggest to have a look at two of the sample projects .
1. CatchingEvents which is available in the folder : C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\02.CatchingEvents
2. EventsFilter which is available in the folder : C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\08.EventsFilter
If you still have any issues, please let us know.
Regards
Arshdeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After creating a project using VB B1 Add on Wizard ,there is a class generated for handling the events for a button
Option Strict Off
Option Explicit On
Imports B1WizardBase
Imports SAPbobsCOM
Imports SAPbouiCOM
Namespace B1AddOn1
Public Class Button__1__3
Inherits B1Item
Public Sub New()
MyBase.New()
FormType = "-1"
ItemUID = "3"
End Sub
<B1Listener(BoEventTypes.et_CLICK, True)> _
Public Overridable Function OnBeforeClick(ByVal pVal As ItemEvent) As Boolean
Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)
Dim item As Item = form.Items.Item("3")
Dim button As Button = CType(item.Specific, Button)
'ADD YOUR ACTION CODE HERE ...
Return True
End Function
End Class
End Namespace
but this code is not working when i clicked the button.
Please help
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.