I am trying to display an UDF value named U_revno in a matrix column automatically when selecting the value in CFL , my code executes well but i am not getting the value in respective field after selecting the value in CFL... and i am getting the value when i give the same code in Matrix0_KeyDownAfter event ....here is my code
Try
Dim oform As SAPbouiCOM.Form
Dim EmpName As String oform = SAPbouiCOM.Framework.Application.SBO_Application.Forms.GetForm("139", formcount)
Dim item As String Dim recordset As SAPbobsCOM.Recordset
Dim revno As String Dim omatrix As SAPbouiCOM.Matrix Dim oedit As SAPbouiCOM.EditText
Dim pCFL As SAPbouiCOM.ISBOChooseFromListEventArg = pVal
If pCFL.ActionSuccess = True Then
If pCFL.ColUID = "1" And Matrix0.GetCellSpecific("1", pCFL.Row).value = Nothing Then
If Not pCFL.SelectedObjects Is Nothing Then
Try omatrix = CType(oform.Items.Item("38").Specific, SAPbouiCOM.Matrix) omatrix.Columns.Item("U_revno").Editable = True
oform.Freeze(True)
item = pCFL.SelectedObjects.Columns.Item("ItemCode").Cells.Item(0).Value
recordset = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset) recordset.DoQuery("select U_revno from OITM where Itemcode='" & item & "'") recordset.MoveFirst() revno = recordset.Fields.Item(0).Value omatrix.GetCellSpecific("U_revno", pCFL.Row).value = revno
Catch ex As Exception
omatrix.GetCellSpecific("U_revno", pCFL.Row).value = revno
oform.Freeze(False)
Finally
oform.Freeze(False)
End Try
End If
End If
End If
Catch ex As Exception
End Try
End Sub
Add comment