Skip to Content
0
Former Member
Jan 11, 2006 at 09:26 AM

Bubble Event firing in one company but not another

21 Views

Having spent the past 2 days trying to get the installer working (which it finally does thanks to people on this forum!), I've finally pushed my add-in out to people this morning.

Unfortunately, the bubbleevent seems to be being ignored in all companies bar the test company.

The code is below. The nominal codes do not begin with "720", so that section is not being fired in either company.

So, my question is, why would a bubble event work in one company but not another?

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

Dim NumberRows As Long

Dim oMatrix As SAPbouiCOM.Matrix

Dim oRowCount As Integer

Dim oCheck As SAPbouiCOM.EditText

Dim oCheck2 As SAPbouiCOM.EditText

REM Check for Profit Centre and Project Code on each line of Purchase Transactions

If pVal.FormTypeEx = "142" Or pVal.FormTypeEx = "141" Or pVal.FormTypeEx = "181" Or _

pVal.FormTypeEx = "139" Or pVal.FormTypeEx = "133" Or pVal.FormTypeEx = "179" Then

REM Set to active form and Sales/Purchase transaction matrix

oForm = oApp.Forms.ActiveForm

oItem = oApp.Forms.Item(FormUID).Items.Item("38")

oMatrix = oItem.Specific

If pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And _

pVal.Before_Action Then

If pVal.ItemUID = "1" Then

NumberRows = oMatrix.RowCount

For oRowCount = 1 To NumberRows - 1

oCheck = oMatrix.Columns.Item("30").Cells.Item(oRowCount).Specific

If oCheck.Value = "" Then

oApp.MessageBox("Please enter a Profit Centre on row " & oRowCount)

BubbleEvent = False

End If

oCheck = oMatrix.Columns.Item("31").Cells.Item(oRowCount).Specific

If oCheck.Value = "" Then

oApp.MessageBox("Please enter a Project on row " & oRowCount)

BubbleEvent = False

End If

oCheck = oMatrix.Columns.Item("U_CarReg").Cells.Item(oRowCount).Specific

oCheck2 = oMatrix.Columns.Item("1").Cells.Item(oRowCount).Specific

If oApp.Company.DatabaseName = "FOLLIS_LIVE" Or oApp.Company.DatabaseName = "FOLLUK_TEST" Then

If oCheck.Value = "" And Left(oCheck2.Value, 3) = "720" Then

oApp.MessageBox("Please enter a Car Registration on row " & oRowCount)

BubbleEvent = False

Exit For

End If

End If

Next oRowCount

End If

End If

End If

REM Check for Profit Centre and Project Code on each line of Nominal Transactions

If pVal.FormTypeEx = "392" Or pVal.FormTypeEx = "393" Then

REM Set to active form, journal matrix

oItem = oApp.Forms.Item(FormUID).Items.Item("76")

oMatrix = oItem.Specific

If pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And _

pVal.Before_Action Then

If pVal.ItemUID = "1" Then

NumberRows = oMatrix.RowCount

For oRowCount = 1 To NumberRows - 1

oCheck = oMatrix.Columns.Item("23").Cells.Item(oRowCount).Specific

If oCheck.Value = "" Then

oApp.MessageBox("Please enter a Profit Centre on row " & oRowCount)

BubbleEvent = False

End If

oCheck = oMatrix.Columns.Item("16").Cells.Item(oRowCount).Specific

If oCheck.Value = "" Then

oApp.MessageBox("Please enter a Project on row " & oRowCount)

BubbleEvent = False

End If

Next oRowCount

End If

End If

End If

End Sub