IVirtualCubeCompounds.FindByKey

Syntax

FindByKey(Key: Integer): IVirtualCubeCompound;

Parameters

Key. Required structure key.

Description

The FindByKey method searches for a structure by the specified key.

Comments

If the structure with the specified key 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.FindByKey(1);
    If VCompound <> Null Then
        Compounds.RemoveByKey(1);
    End If;
    (VirtCube As IMetabaseObject).Save;
End Sub UserProc;

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

See also:

IVirtualCubeCompounds