IDimHierarchies.Remove

Syntax

Remove(Index: Integer): Boolean;

Parameters

Index - hierarchy index in the collection.

Description

The Remove method removes alternative hierarchy from the collection by its index. The method returns True if the hierarchy is successfully removed.

Example

Executing the example requires that the repository contains a dictionary with the TB_BASE identifier.

Sub Main;

Var

Mb: IMetabase;

OriginalModelObj: IMetabaseObject;

OriginalModel: IDimensionModel;

Hierarchies: IDimHierarchies;

i: Integer;

Hierarchy: IDimHierarchy;

Begin

Mb := MetabaseClass.Active;

OriginalModelObj := Mb.ItemById("TB_BASE").Edit;

OriginalModel := OriginalModelObj As IDimensionModel;

Hierarchies := OriginalModel.Hierarchies;

If Hierarchies.Remove(0) Then

Debug.WriteLine("Alternative hierarchy is successfully deleted");

Else

Debug.WriteLine("Alternative hierarchy was not deleted");

End If;

End Sub Main;

After executing the example console window displays information on deleting the first alternative hierarchy from collection of the TB_BASE dictionary.

See also:

IDimHierarchies