IMetabase.DeleteObject

Syntax

DeleteObject(Key: Integer);

DeleteObject(Key: uinteger);

Parameters

Key. Key of the object that is being deleted.

Description

The DeleteObject method deletes an object, which key is passed by the Key input parameter.

Example

Executing the example requires that the repository contains an object with the TestObj identifier.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    Obj: IMetabaseObjectDescriptor;
Begin
    MB := MetabaseClass.Active;
    Obj := MB.ItemById("TestObj");
    MB.DeleteObject(Obj.Key);
End Sub UserProc;
Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Obj: IMetabaseObjectDescriptor;
Begin
    MB := Params.Metabase;
    Obj := MB.ItemById["TestObj"];
    MB.DeleteObject(Obj.Key);
End Sub;

After executing the example if the repository contains an object with the TestObj identifier, it is deleted.

See also:

IMetabase