Skip to Content
0

How to add data in UDT of SAP B1 in SDK?

Feb 18 at 09:26 PM

45

avatar image

Hi all,

I have a problem of adding record in UDT of SAP B1 in SDK.

    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
        If pVal.FormTypeEx = "UDO_FT_RPRL" AndAlso pVal.ActionSuccess = False AndAlso pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED AndAlso pVal.ItemUID = "1" AndAlso pVal.FormMode = 3 Then


            Dim oUsrTbl As SAPbobsCOM.UserTable
            Dim Res As Integer
            oCompany = New SAPbobsCOM.Company
            oUsrTbl = oCompany.UserTables.Item("@TODD")
            oUsrTbl.Code = "1"
            oUsrTbl.Name = "189"
            oUsrTbl.UserFields.Fields.Item("U_Amount").Value = 4000
            Res = oUsrTbl.Add()
            If Res = 0 Then
                SBO_Application.MessageBox("Added")
            Else
                SBO_Application.MessageBox("Error, failed to add Record")
            End If
        End If


    End Sub

I tried to do research but not help

Actually what I want to do is if I click on Add button of UDO then it updates my UDT called @TODD, but if I click Add button above codes bring the following error message " Addon 9000058 failed with exception; Event Type: 1"

Please anyone can help me

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Rurangwa Schadrack Feb 19 at 01:36 PM
0

Hi all,

I did it by connecting to DIAPI

Thank you all

Share
10 |10000 characters needed characters left characters exceeded