Show contents 

Dimensions > Dimensions Assembly Interfaces > IUserDimBlocks > IUserDimBlocks.FindByKey

IUserDimBlocks.FindByKey

Syntax

FindByKey(BlockKey: Integer): IUserDimBlock;

Parameters

BlockKey. Block key, by which search is executed.

Description

The FindByKey method searches and returns an object containing calculated dictionary block. Search is executed by the key passed by the BlockKey parameter.

Example

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    UsDim: IUserDimension;
    UsDimBlocks: IUserDimBlocks;
    UsDimBlock: IUserDimBlock;
    s: String;
Begin
    MB:=MetabaseClass.Active;
    MObj:=MB.ItemById("USER_DIM").Edit;
    UsDim:=MObj As IUserDimension;
    UsDimBlocks:=UsDim.Blocks;
    UsDimBlock:=UsDimBlocks.FindByKey(5289);
    If UsDimBlock<>Null Then
        s:=UsDimBlock.Name;
    Else
        s:="It Is not found";
    End If;
    MObj.Save;
End Sub UserProc;

After executing the example the method searches for the block with the 5289 key, and if the search is successful, the "s" variable contains the name of the block found. Calculated dictionary identifier - USER_DIM.

See also:

IUserDimBlocks