on 11-13-2007 4:21 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
'--
<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
'----
Can some please help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
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.