cancel
Showing results for 
Search instead for 
Did you mean: 

Access to UDO via DI

Former Member
0 Kudos

Hi,

we wanted to know if there's a possibility to gain access to a user defined object (UDO) via the DI Api. We wondered if there might be a way to handle UDOs similar to BO system objects, that is to say by requesting a reference using the 'GetBusinessObject' method in order to manipulate them within the source code.

As far as we know yet, the only possibility to perform changes on a UDO is by using the form user interface.

Regards,

Jürgen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Have a look at the UserObjectsMD, it should provide the functionality you're expecting.

From DI help file:

UserObjectsMD is a non-business object that 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.

Source table: OUDO.

Florian Zeller

Former Member
0 Kudos

Unfortunately you do not get a UserObject/UDO as object-reference using the UserObjectsMD (in C#), you only get the properties of the UDO.

As the UDOs seem to be intended to be the user-alternative to the business-objects like BPBankAccounts one would expect to be able to get/create a UDO-reference. Now the UDOs seem to work inaccessible in the background.

Ch. Becker

rasmuswulff_jensen
Active Contributor
0 Kudos

Try this:

UserObjectsMD udo = (UserObjectsMD)sboCompany.GetBusinessObject(BoObjectTypes.oUserObjectsMD);

udo.Code = "UID";

udo.Name = "name";

udo.ObjectType = BoUDOObjType.boud_MasterData;

udo.TableName = tabel;

if(udo.Add() != 0) {

throw new Exception("ERROR");

}

Former Member
0 Kudos

The UserObjectsMD object simply seems to be a meta-data object which contains information about the udo's structure (tables, types, etc..).

My question is how can I retrieve a certain record from the udo using the DI Api?

As Florian mentioned correctly the help files anounce the retrieval of a user defined object by its key using the UserObjectsMD object. But I think this is somehow misleading because you can't retrieve the user object itself (like you can using system business objects) but the meta-data which describes the object.

Perhaps, somebody came across the same problem and found a solution.

Regards,

Jürgen

rasmuswulff_jensen
Active Contributor
0 Kudos

Ohhh.. I get it now... No it does not seem to bee any access to it (Otherwise there would have been a company.userobjects.item or somthing like that)... Guess only option is using the recordset (not a good option)

former_member185703
Active Contributor
0 Kudos

Hi,

Accessibility to UDOs via DI API - besides their definitions by using UserObjectsMD - is planned for version 2005.

Until then you could use RecordSet for reading purposes (but just for that!!! because of the numerous internal fields contained in a UDO table).

The UserTable object (which represents a record in a user-defined table - just in case you didn't notice yet) for writing, unfortunately does not support working with UDO tables.

So, waiting for version 2005 (supposed to be available somewhen around the middle of 2005) is the only true option, if you cannot use the UDO inside SAP Business One UI.

Regards,

Frank

Former Member
0 Kudos

So it is either rearranging all tables a way they match into the "Master Data/Document Data Table refers to Lines Table"-schema or sticking to the old way: "RecordSet + UserTables" for accessing and displaying data different from the above scheme? For example displaying a Lines Table in a form on its own?

Nothing in between yet, except maybe manipulating on UI-API-level?

former_member185703
Active Contributor
0 Kudos

Right.

Data migration from existing UDTs to UDO-UDTs can at this point in time only happen via SAP Business One UI:

Note that DBDataSource is much more powerful now!!!!! =>

You can add complete lines/rows (not in SAP B1 system forms ...) and afterwards add the data to the database - without using DI API...

I.e. you could create open form, retrieve data from existing UDTs via one DBDataSource and add the data to the DBDataSource for the new UDO UDT + then click the "Add" button on your form (must be in Add mode then, of course). That should do the trick!!!!

I didn't try exactly this - just worked with UDO, but this is the way it should work; maybe there are preconditions to have the particular DBDataSource fields bound to UI items, but I would expect this not to be necessary...

Regards,

Frank

Answers (0)