IVirtualCubeCompounds.FindById

Syntax

FindById(Id: String): IVirtualCubeCompound;

Parameters

Id. Required structure identifier.

Description

The FindById method searches for a structure by the specified identifier.

Comments

If the structure with the specified identifier is not found, the method returns Null.

Example

Executing the example requires that the repository contains a virtual cube with the CUBE_VIRT identifier. Also, add links to the Metabase, Cubes system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    VirtCube: IVirtualCube;
    Compounds: IVirtualCubeCompounds;
    VCompound: IVirtualCubeCompound;
Begin
    Mb := MetabaseClass.Active;
    VirtCube := Mb.ItemById("CUBE_VIRT").Edit As IVirtualCube;
    Compounds := VirtCube.Compounds;
    VCompound := Compounds.FindById("COMPOUND_USER");
    If VCompound <> Null Then
        Compounds.RemoveByKey(VCompound.Key);
    End If;
    (VirtCube As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the predetermined structure with the COMPOUND_USER identifier (if it is present in cube) is removed from the virtual cube.

See also:

IVirtualCubeCompounds