Remove(PrimaryKey: Variant);
PrimaryKey. Primary key of removed element.
The Remove method removes element with the specified primary key.
All child elements are removed with the element.
Executing the example requires a standard cube with the CUBE_1 identifier.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Cube: IStandardCube;
CustDim: ICustomDimension;
CustDimTree: ICustomDimTree;
TreeChild: ICustomDimTreeChildren;
v: Variant;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("CUBE_1").Edit;
Cube := MObj As IStandardCube;
CustDim := Cube.FactDimension.Dimension As ICustomDimension;
CustDimTree := CustDim.Tree;
TreeChild := CustDimTree.RootChildren;
v := TreeChild.Item(TreeChild.Count - 1);
CustDimTree.Remove(v);
MObj.Save;
End Sub Main;
After executing the example the last root element of fact dimension is removed.
See also: