Skip to Content

How to add data in database using user Table in sapb1 sdk

I am trying to save data in database using user table but i am unable to catch fields for storing data.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Dec 28, 2016 at 01:26 AM

    Hi,

    Quoted from SAP Business One Help File RefDI.chm

    Private Sub Add_Data_Click()
        Dim oUserTable As SAPbobsCOM.UserTable
        Set oUserTable = oCompany.UserTables.Item(1)
    
        'Set default, mandatory fields
        oUserTable.Code = "A"
        oUserTable.Name = "Albert"
        'Set user field
        oUserTable.UserFields.Fields.Item("U_AlbUDF").Value = "1"
    
        oUserTable.Add
    
        If ret <> 0 Then
            oCompany.GetLastError ret, Str
            MsgBox Str
        Else
            MsgBox "Value to field: '" & oUserTable.UserFields.Fields.Item("U_AlbUDF").Name & "' was updated successfuly to "  & oUserTable.TableName & " Table"
        End If
    End Sub
    

    Regards
    Edy

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 28, 2016 at 07:25 PM

    Thanks Edy Simon .Yes i use this, Actually i found. it my table is master data type and solution is to create a table with SAPbobsCOM.BoUTBTableType.bott_NoObject.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 29, 2016 at 01:16 AM

    I see, master data type needs to be bound to UDO and add the values from General Data Service.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 30, 2016 at 07:29 AM

    I am Creating Form Without UDO and add() ,Update() data using userTable. and know i try to navigate data?

    Add comment
    10|10000 characters needed characters exceeded