on 09-18-2008 12:13 PM
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
Hi Satyapal,
Please add your own code where it says 'ADD YOUR ACTION CODE HERE ...
For example something like: MessageBox.Show("this is a test")
The generated code does not perform any action. It generates the class structures, methods etc. so you can focus on implementing the business/functional logic.
Regards
Aravind
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
the questions is: what is the error ?
use try catch
in your code and post the error message here.
lg David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David ,
thank you for the help.
But my question is, after creating the project using VB B1AddOn Wizard ,so many class files are generated for each component (Button1,Button2,EditText1,EditText2,ComboBox...)
and corresponding listeners are in the file, but this events are not working. There is no errors.
Please Help
Hi,
maybe you should first have a look at the SDK samples to get a better overview about
how to develop Business One AddOns and how the structure of the code looks like.
a bit offtopic:
honestly i don't like wizard generated templates.
i invested once some time to make my own template; in my opinion that's way more professional.
lg David
User | Count |
---|---|
99 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
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.