IMetabase.ItemById

Syntax

ItemById(Id: String): IMetabaseObjectDescriptor;

Parameters

Id.Identifier of repository object.

Description

The ItemById property returns description of the repository object with the specified identifier.

Comments

All object identifiers are unique in the frame of repository. Objects-containers (MDM repository, modelling container, web application) has their own identifier space, so objects with the same identifiers as in repository can be created there.

The ItemById property returns description of the object, if their identifier will be found in repository object tree. The objects-containers contents is not considered. To work with objects inside objects-containers, use the IMetabase.ItemByIdNamespace property.

The property returns Null, if object with the specified identifier is not found in repository object tree.

Example

To execute the example, add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MDesc: IMetabaseObjectDescriptor;
Begin
    MB := MetabaseClass.Active;
    MDesc := MB.ItemById("TestObj");
    If MDesc <> Null Then
        Debug.WriteLine(MDesc.Name);
    Else
        Debug.WriteLine("Object is absent in repository objects. Perhaps, it exists in one of objects - containers.");
    End If;
End Sub UserProc;

After executing the example if an object with the TestObj identifier exists in the repository, its name is displayed in a development environment console.

See also:

IMetabase