📚 SAP Business One SDK Help

User ObjectsMD Object
See Also  Members  Example

Description

The UserObjectsMD object represents the registration data settings, such as table name and supported services, of a user defined object.

This object enables you to:

  • Add a user define object.
  • Retrieve a user define object by its key.
  • Update a user define object .
  • Remove a user define object from the database.
  • Save the object in XML format.
  • Specify the menu location of the UDO.

Source table: OUDO.


IMPORTANT: After creating a new UDO in .NET, you must release the object by executing the following line of code, where myObject is a reference to the UserObjectsMD object:

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

Object Model









Remarks

Mandatory fields in SAP Business One: Code and TableName.

To activate the registration wizard in the application:

  • Select Tools > User Defined Object > User Defined Object Registration.

For more information, see the User Defined Object documentation.

Example

Specifying the Menu Location of the UDO (C#)Copy Code
// Updating a UDO to have a Menu item. 
UserObjectsMD udo = cmp.GetBusinessObject(BoObjectTypes.oUserObjectsMD) as UserObjectsMD; 
             
// Get UDO 
udo.GetByKey("MyUDO"); 
 
// Set UDO to have a menu 
udo.MenuItem = BoYesNoEnum.tYES; 
udo.MenuCaption = "My UDO menu"; 
 
// Set father and position of menu item. 
udo.FatherMenuID = 43535; // Business Partners menu UID 
udo.Position = 1; 
 
// Set UDO menu UID 
udo.MenuUID = "mn_MyUDO"; 
 
// Update UDO to have the new menu item 
udo.Update(); 








See Also