on 09-28-2005 6:38 PM
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")
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.