How to get Object Id from an Object via VBA

I’m triying to get the Objects of a document, I only get the name of them but what i need is the ID.
Thanx


Manu (BOB member since 2004-08-02)

First Manu, welcome to BOB! We hope you will find it a valuable resource.

Second, it would help if you gave us some framework for your question. I honestly can’t think of a reason to need to know the “internal ID number” for an object, so I’m interested in understanding your reason.

Third, I do believe there is a way, if you are OK with using an “unsupported” portion of the VBA object model. It’s not that easy, but I think it would work.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

We need to know exactly wich objects are in each document, the problem is that you can have different objects in the same universe with the same name, that´s the reason why we need the object ID. I´m OK with any solution, we are now using “unsupported” parts of BO.
Thanx a lot.


Manu (BOB member since 2004-08-02)

Hi,

this is pretty simple. If you know the name of the report you can access the Univerese directly to retrieve the DocId.

The table where the document properties are stored is OBJ_M_DOCUMENTS, the column with the id is - iirc - M_DOC_N_ID, the column with the name is M_DOC_C_NAME,

so a

SELECT M_DOC_N_ID FROM $SCHEMA.OBJ_M_DOCUMENTS WHERE M_DOC_C_NAME=’$NAME’

should do the job.

It’s way faster then the BO approach, at least in Java.

cu,

olli


haupto :de: (BOB member since 2004-04-16)

Which IMHO is a bad practice to begin with.


Andreas :de: (BOB member since 2002-06-20)

Hi,

depends.

If you prefer to wait about 30 seconds at least to retrieve all document names wihin a category or to load a WI doc first over the session to retrieve its id you’re right.

I prefer to load the id’s quickly over a JDBC connection and work afterwards with the ‘normal’ BO methods.

cu,

olli


haupto :de: (BOB member since 2004-04-16)

Ahh, but the class / object combination is guaranteed to be unique. Anything I’ve ever done for “objects used” simply includes both class name and object name. Actually, come to conference in November and I’ll be demonstrating a “what objects are used where” utility along with other SDK tools for automating universe maintenance.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Thanx to all. I finally found a solution using the repository tables of BO.


Manu (BOB member since 2004-08-02)