Skip to Content
author's profile photo Former Member
Former Member

Usert Tabla type document

i create a tableuser document type in the SBO,with the fields "code","name" for example

what i want is add values,then read it and finally

delete all the values

someone know how to do this thnxs

Dim vUserTables As SAPbobsCOM.UserTablesMD

Set vUserTables = vCompany.UserTables.item("TEMP")

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2005 at 06:54 AM

    Hi Miguel,

    The UserTablesMD object is used for creating and maintaining the table structure. It is not used for maintaining data within the table. For this purpose the UserTable object is used. Herewith example code of how to insert, read and delete from a UserTable

            'insert
            Dim vUserTable As SAPbobsCOM.UserTable
            vUserTable = oCompany.UserTables.Item("TEMP")
            vUserTable.Code = "1"
            vUserTable.Name = "Item 1"
            vUserTable.UserFields.Fields.Item("U_Field1").Value = "Value 1"
            vUserTable.UserFields.Fields.Item("U_Field2").Value = "Value 2"
            If vUserTable.Add <> 0 Then
                MessageBox.Show("Error: " & oCompany.GetLastErrorDescription)
            End If
    
            'read
            vUserTable = oCompany.UserTables.Item("TEMP")
            vUserTable.GetByKey("1")
            MessageBox.Show(vUserTable.Name)
    
            'delete
            vUserTable = oCompany.UserTables.Item("TEMP")
            vUserTable.GetByKey("1")
            If vUserTable.Remove <> 0 Then
                MessageBox.Show("Error: " & oCompany.GetLastErrorDescription)
            End If

    Hope it helps,

    Adele

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.