GetObjectKeyById(Value: String): Integer;
Value is an object identifier.
The GetObjectKeyById method returns a unique object key, which identifier is passed by the Value input parameter.
If an object with the specified key doesn't exist, the method returns the "-1" value.
Sub Main;
Var
MB : IMetabase;
ObjKey: Integer;
Begin
MB := MetabaseClass.Active;
i := MB.GetObjectKeyById("TestObj");
If i <> -1 Then
MB.DeleteObject(i);
End If;
End Sub Main;
After executing the example if there is an object with the TestObj identifier in the repository, it is deleted.
See also: