Skip to Content
avatar image
Former Member

Add row in matrix before event update in sales orders views - UI API


I use SAP Business One 9.0 and SAP UI API 9.0 with a VB.NET addon.

I want to add a row in a matrix of the sales orders form before the event data update and cancel the update if some product are present in the orders.

I try to do it with the event data load after the action and it's worked.

When I do it with the event data update before the action the text appear in the cell but with an error and the row is not filled with the item information.

Public Sub FormDataEvent(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean) Handles SBO_Application.FormDataEvent

        Dim action As String = BusinessObjectInfo.ActionSuccess.ToString()
        Dim evt AS String = BusinessObjectInfo.EventType.ToString()
        Dim form As SAPbouiCOM.Form = SBO_Application.Forms.ActiveForm

        If evt = "et_FORM_DATA_UPDATE" And action = "False" Then

            Dim matrix as SAPbouiCOM.Matrix = form.Items.Item("38").Specific
            Dim row = matrix.Columns.Item("1").Cells.Count
            Dim editText as SAPbouiCOM.EditText = matrix.Columns.Item("1").Cells.Item(row).Specific
            editText.Value = "55549"

            BubbleEvent = False

        End If

End Sub

Error in SAP B1 UI:

Error in VB.NET:

Anybody can help me, please?

Thanks and regards.

captura.png (7.7 kB)
captura2.png (18.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers