Remove(Index: Integer): Boolean;
Index - hierarchy index in the collection.
The Remove method removes alternative hierarchy from the collection by its index. The method returns True if the hierarchy is successfully removed.
Executing the example requires that the repository contains a dictionary with the TB_BASE identifier.
Sub UserProc;
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 was removed successfully");
Else
Debug.WriteLine("Alternative hierarchy was not removed");
End If;
End Sub UserProc;
After executing the example console window displays information on deleting the first alternative hierarchy from collection of the TB_BASE dictionary.
See also: