IDynamicInstance.AttributeValueById

Syntax

AttributeValueById(Element: Integer; AttributeId: String): Variant;

Parameters

Element. Index of dictionary element.

AttributeId. Attribute identifier.

Description

The AttributeValueById property determines dictionary element attribute value by attribute identifier.

Example

Executing the example requires a form containing the DimensionTree component with the DimensionTree1 identifier, the UiDimension component with the UiDimension1 identifier and the Button component with the Button1 identifier. Determine the UiDimension1 component as data source for the DimensionTree1 component. Data source for the UiDimension1 component must be MDM table dictionary with set dynamic loading of elements.

The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Dim: IDynamicInstance;
    AttrsInst: IDimAttributesInstance;
    Element: Integer;
Begin
    Dim := UiDimension1.DimInstance As IDynamicInstance;
    // Get collection of dictionary attributes instances
    AttrsInst := Dim.CreateAttributesInstance;
    Element := DimensionTree1.FocusedElement;
    // Display real attribute value of selected element
    Debug.WriteLine("Real value of the KEY attribute of selected element: " + 
        Dim.AttributeValueById(Element, "KEY"));
    // Show displayed attribute value of selected element
    Debug.WriteLine("Displayed value of the KEY attribute of selected element: " + 
        Dim.DisplayValueById(Element, "KEY"));
End Sub Button1OnClick;

On clicking the Button1 button the console displays real and displayed values of the KEY attribute of selected element.

See also:

IDynamicInstance