📚 SAP Business One SDK Help

UserTablesMD Object
See Also  Members  Example

Description

The UserTablesMD object enables to manage user defined tables as follows:

  • Add a user table.
  • Retrieve a user table from the database by its TableName.
  • Remove a user table.
  • Save the object in XML format.

Source table: OUTB.


IMPORTANT: After creating a new user-defined table in .NET, you must release the object by executing the following line of code, where myObject is a reference to the UserTablesMD object:

System.Runtime.InteropServices.Marshal.ReleaseComObject(myObject); 

Object Model





Remarks

DI API allows only one metadata object instance (with no other instances of any object type). This maintains data integrity by preventing any manipulation of a business object while modifying the object's properties.

To display the form in the application:

  1. From the main menu bar, select Tools --> Manage User Fields.
  2. Click User Tables.

Example

Adding a UserTable to the Database in a Transaction (Visual Basic)Copy Code
Dim oUsrTbl As SAPbobsCOM.UserTablesMD

Set oUsrTbl = oComp.GetBusinessObject(oUserTables)

oComp.StartTransaction

oUsrTbl.TableName = "MyTbl1"
oUsrTbl.TableDescription = "MyTbl1"
RetVal = oUsrTbl.Add

If oComp.InTransaction Then
    oComp.EndTransaction
End If





Example

See Also