on 01-15-2008 9:53 PM
I have the folllowing code in the item event:
If pVal.FormTypeEx = "mcgscomm" Then
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.BeforeAction = False Then
If pVal.ItemUID = "btnOk" Then
CleanForm(oForm)
End If
End If
End If
The Cleanform routines is as follows:
Private Sub CleanForm(ByRef oForm As SAPbouiCOM.Form)
Dim oMatrix As SAPbouiCOM.Matrix
Dim oStaticText As SAPbouiCOM.StaticText
Dim oEditText As SAPbouiCOM.EditText
oMatrix = oForm.Items.Item("M_Matrix").Specific
oMatrix.Clear()
oStaticText = oForm.Items.Item("mcg_CName").Specific
oStaticText.Caption = ""
oEditText = oForm.Items.Item("mcg_Date").Specific
oEditText.Value = ""
oEditText = oForm.Items.Item("mcg_Inv").Specific
oEditText.Value = ""
oForm.DataSources.UserDataSources.Item("StatusDS").ValueEx = "Selected"
oForm.DataSources.UserDataSources.Item("SlspDS").ValueEx = ""
oForm.DataSources.UserDataSources.Item("CustDS").ValueEx = ""
oForm.DataSources.UserDataSources.Item("SalesDS").ValueEx = 0
oForm.DataSources.UserDataSources.Item("CostDS").ValueEx = 0
oForm.DataSources.UserDataSources.Item("CommDS").ValueEx = 0
oForm.DataSources.UserDataSources.Item("CPerDS").ValueEx = 0
oEditText.Active = True
End Sub
The issue is that the cleanform executes without problem but when the item event completes the application crashes (I'm not getting any messages from the debugger so it's making hard to determine the issue). Any suggestions?
Regards,
WB
hi william,
the only thing i see is that you don't freeze the form.
you're creating events when you "clear" your form and slow down
your code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
did you tried try catch syntax for errors? If yes, there was no error?
Petr
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The reason I posted the code is if somebody wanted to test it. There is an error the program is crashing, it crashing during debug mode. What I don't understand is why it crashing when the event is done, it's not crashing in the middle of the routines it's after calling the clean routine from the event routine.
The code is .net 2005
Regards,
WB
VB.NET: good. Then you can use B1 .NET Profiler to understand what you addon is really doing. This tool will profile the execution of your addon by tracing all the DI and UI calls (and event handling) and will trace also exception raised. You don't need neither debug nor source code as it profiles directly the execution doing some magic in the CLR.
It is part of B1TE. You can download it under the section "Business One SDK Tools". It comes with setup / documentation and source code too.
Enjoy.
Thanks for the suggestion, I figure it out. The .net profiler gave me an idea where it was crashing, now the weird thing and in this case I think is VS.NET that has a bug with the DI/UI API. When I changed the editbox, this was triggering a et_VALIDATE event that I'm trapping in the item event. Now the debugger was running the event code but it was not showing it, if I placed a breakpoint it will never stop so that was not letting me know that the error was occurring there.
As soon as I figure it out a small if statement fixed the problem.
Thanks to all,
WB
User | Count |
---|---|
104 | |
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.