GetObjectKeyByIdNamespace(Value: String; [Namespace_: Integer = 0]): Integer;
Value. Identifier of repository object.
Namespace. The key of the container object, in which the repository object will be searched.
The GetObjectKeyByIdNamespace method returns the key of the object, located in the specified container by its identifier.
The 0 value is set by default for the Namespace parameter, that is, the search is executed by objects of the entire repository (objects from the root with the 0 key).
If the method is used via the Fore code, provided that the object with the specified identifier already does not exist, the method returns -1.
If the code is written in third-party development environments, and the object with the specified identifier does not exist, the method returns UInteger.MaxValue.
Executing the example requires that the repository contains an object with the OBJ123 and a container with the 63 key.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
ObjKey: Integer;
Begin
MB := MetabaseClass.Active;
ObjKey := MB.GetObjectKeyByIdNamespace("OBJ123", 63);
Debug.WriteLine(ObjKey);
End Sub UserProc;
After executing the example the development environment console displays the object key with the OBJ123 identifier.
See also: