Skip to Content
author's profile photo Former Member
Former Member

B1DE - set Bubble Event to False

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Nov 14, 2007 at 09:40 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

      '----


  • author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2007 at 10:47 AM

    Can some please help.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.