Skip to Content

The server threw an exception error - ItemEvent - SAP Business One

Sep 27, 2017 at 10:39 PM


avatar image

Hello All,

Kindly, I need an urgent help to solve this issue. I've created simple add-on an imported it into SAP B1. I've gotten these errors in the screen shots, which I've attached. This is my code, I've created into Visual Studio (VB.Net). I use SAP B1 PL06. An this issue is related to ItemEvent, It stops the application

Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
' Events of the Blanket Agreement form
If (FormUID = "BILL") Then
If (pVal.Before_Action = False) Then

' Click on Add Row
If (pVal.ItemUID = "AddRow") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then
Dim f As SAPbouiCOM.Form
Dim oMatrix As SAPbouiCOM.Matrix
f = SBO_Application.Forms.Item(FormUID)
oMatrix = f.Items.Item("mat").Specific
End If

' After selecting a BP Code from the combo box
If (pVal.ItemUID = "txtCode") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_COMBO_SELECT) Then
txtBPName.Value = cmbBPCode.Selected.Description
End If

' After selecting an item from the combo box
If (pVal.ItemUID = "mat") And (pVal.ColUID = "ItemCode") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_COMBO_SELECT) Then

Dim oEdit As SAPbouiCOM.EditText
Dim oCombo As SAPbouiCOM.ComboBox

oCombo = colItemCode.Cells.Item(pVal.Row).Specific
oEdit = colItemName.Cells.Item(pVal.Row).Specific
oEdit.Value = oCombo.Selected.Description
End If

' After changing the Total Row

If (pVal.ItemUID = "mat") And (pVal.ColUID = "ACuts") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_VALIDATE) Then

Dim oEditTotal As SAPbouiCOM.EditText ' Total Bill

' Get the items from the matrix

oEditTotal = colItemACuttings.Cells.Item(pVal.Row).Specific

' Copy the value to the Initial sum

'Dim tmpInt As Integer

'tmpInt = CInt(oEditQuan.Value)

'oInitQuan.Value = tmpInt

' Calc the total column

'Dim tmpTotal As Integer ' temp variable to contain total result
'tmpTotal = CInt(oEditTotal.Value)
'oEditTotal.Value = CInt(tmpTotal)

' Calc the document total

Dim CalcTotal As Double
Dim i As Integer

CalcTotal = 0

' Iterate all the matrix rows

For i = 1 To oMatrix.RowCount

oEditTotal = colItemACuttings.Cells.Item(i).Specific
CalcTotal += oEditTotal.Value


oDocTotal.Value = CalcTotal

End If
End If
End If

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers