Dimensions > Dimensions Assembly Interfaces > IUserDimBlocks > IUserDimBlocks.FindByKey
FindByKey(BlockKey: Integer): IUserDimBlock;
BlockKey. Block key, by which search is executed.
The FindByKey method searches and returns an object containing calculated dictionary block. Search is executed by the key passed by the BlockKey parameter.
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: