cancel
Showing results for 
Search instead for 
Did you mean: 

B1DE - set Bubble Event to False

Former Member
0 Kudos

Under Sales Order Line, I tried to pass in a description different from Original Item description. I used SendKeys function to pass in the {^TAB} but the Item Search still pupop and throw error message "Bad Value".

I knew by setting the BubbleEvent to False will solve this problem. But i could not find it under B1DE listener. Below is my code for form 139.

Public Class Matrix__SO139__38

Inherits B1Item

Public Sub New()

MyBase.New()

FormType = "139"

ItemUID = "38"

End Sub

<B1Listener(BoEventTypes.et_ITEM_PRESSED, True)> _

Public Overridable Function OnBeforeItemPressed(ByVal pVal As ItemEvent) As Boolean

Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)

Dim item As Item = form.Items.Item("38")

Dim matrix As Matrix = CType(item.Specific, Matrix)

'ADD YOUR ACTION CODE HERE ...

Try

'Auto insert a row in Order

If pVal.ColUID = "U_TruckNo" Then

B1Connections.theAppl.MessageBox(pVal.Row)

matrix.AddRow(1)

B1Connections.theAppl.MessageBox(pVal.Row)

Dim oEdit As SAPbouiCOM.EditText

Dim oText As SAPbouiCOM.EditText

oText = matrix.Columns.Item("1").Cells.Item(pVal.Row).Specific

'oText.String = "A0000010"

oEdit = matrix.Columns.Item("1").Cells.Item(pVal.Row + 1).Specific

oEdit.String = oText.String '"A0000010"

oEdit = matrix.Columns.Item("3").Cells.Item(pVal.Row + 1).Specific

oEdit.Active = True

oEdit.String = "Over time"

DoEvents()

B1Connections.theAppl.SendKeys("^")

End If

Catch ex As Exception

MsgBox(ex.Message)

End Try

Return True

End Function

End Class

Accepted Solutions (1)

Accepted Solutions (1)

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

The bubble event variable has been packaged in B1DE as the return value from the method called per each event (OnBeforeChooseFromList method for example in the autogenerated code).

If you return "true" (default value in autogenerated code) then bubble event = true.

Return True

End Function

If you return "false" then bubble event = false.

Return False

End Function

Hope it helps

Trinidad.

Former Member
0 Kudos

How can i return true ?

Where can i set the return in my code ?

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Lai,

Just at the end of your Function managing the event (code autogenerated)

.....

Return False

End Function

Please search other threads in this forum, there are several explaining how to do it.

Trinidad.

Former Member
0 Kudos

Yes. you are right. thanks a lot.

Former Member
0 Kudos

if faced the problem turning off bubble event. after upgrading to 2005B SP00 PL34.

The following is my codes. I found that the Item Description CFL still appeared. Please advise.

'--


codes--


<B1Listener(BoEventTypes.et_VALIDATE, False)> _

Public Overridable Function OnValidate(ByVal pVal As ItemEvent) As Boolean

Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)

Dim item As Item = form.Items.Item("38")

Dim matrix As Matrix = CType(item.Specific, Matrix)

'ADD YOUR ACTION CODE HERE ...

Dim oEdit As EditText

Dim oEdit2 As EditText

If pVal.InnerEvent = False Then

Try

Select Case pVal.ColUID

Case "U_SVSCODE", "U_CHGTYPE"

Dim cls As New ServicePriceList

Dim oSvsCode As EditText = matrix.Columns.Item("U_SVSCODE").Cells.Item(pVal.Row).Specific

Dim oChgType As ComboBox = matrix.Columns.Item("U_CHGTYPE").Cells.Item(pVal.Row).Specific

If IsNothing(oChgType.Selected) Or IsNothing(oSvsCode) Then

Exit Try

End If

If cls.GetServicePrice(oSvsCode.String, oChgType.Selected.Value) = True Then

form.Freeze(True)

cls.SvsCode = oSvsCode.Value

cls.BillingChgType = oChgType.Selected.Value

oEdit = matrix.Columns.Item("1").Cells.Item(pVal.Row).Specific

oEdit.String = cls.ItemCode.ToString

oEdit2 = matrix.Columns.Item("3").Cells.Item(pVal.Row).Specific

oEdit2.Active = True

System.Windows.Forms.Application.DoEvents()

oEdit2.String = cls.svsDesc.ToString

System.Windows.Forms.Application.DoEvents()

B1Connections.theAppl.SendKeys("^")

form.Freeze(False)

End If

'Cleanup

cls = Nothing

End Select

Catch ex As Exception

B1Connections.theAppl.SetStatusBarMessage(ex.Message, BoMessageTime.bmt_Medium, True)

form.Freeze(False)

End Try

End If

Return False

End Function

'----


Answers (1)

Answers (1)

Former Member
0 Kudos

Can some please help.

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi ,

Have you tried to block the ChooseFromList instead of the Validate?

Regards

Trinidad.