GetObjectKeyByIdNamespace(Value: String; [Namespace_: Integer = 0]): Integer;
GetObjectKeyByIdNamespace(Value: String; Namespace_:uinteger) : uinteger;
Value. Identifier of repository object.
Namespace_. The key of the container object in which the repository object search will be performed. By default the 0 value is set, that is the search is performed by objects of the entire repository (objects from the root with 0 key).
The GetObjectKeyByIdNamespace method returns the key of the object, located in the specified container by its identifier.
If there is no object with the specified identifier in the specified repository then the -1 value returns.
Executing the example requires an object with the OBJ123 identifier and a container with the 63 key in the repository.
Sub UserProc;
Var
MB: IMetabase;
ObjDesc: Integer;
Begin
MB:= MetabaseClass.Active;
ObjDesc:= MB.GetObjectKeyByIdNamespace("OBJ123", 63);
Debug.WriteLine (ObjDesc);
End Sub UserProc;
After executing the example the key of the object with OBJ123 identifier will be displayed in the development environment console if this object is located in the container with 63 key. Otherwise the -1 value will be displayed.
Executing the example requires an object with the OBJ123 identifier and a container with the 63 key in the repository.
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
ObjDesc: uinteger;
Begin
MB:= Params.Metabase;
ObjDesc:= MB.GetObjectKeyByIdNamespace("OBJ123", 63);
System.Diagnostics.Debug.WriteLine(ObjDesc.ToString());
End Sub;
The result of the example execution is similar to the Fore Example result.
See also: