IRdsDictionaryElements.Dependents

Syntax

Dependents(Element: Integer): IRdsDictionaryElementDependents;

Parameters

Element. Key of the element, for which dependencies should be obtained.

Description

The Dependents property returns the collection of element dependencies, which key is passed by the input parameter.

Comments

Use the Element or the IRdsDictionaryElement.Key property to get an element key.

Example

Executing the example requires a form with the Button1 button, the DimensionTree component named DimensionTree1, and the UiDimension component named UiDimension1 that is a data source for DimensionTree1. Data source is connected with the MDM dictionary that supports tracking of links to elements.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    MB: IMetabase;
    Dict: IRdsDictionaryInstance;
    Elements: IRdsDictionaryElements;
    Depends: IRdsDictionaryElementDependents;
    MDescs: IMetabaseObjectDescriptors;
    MDesc: IMetabaseObjectDescriptor;
Begin
    MB := MetabaseClass.Active;
    Dict := UiDimension1.DimInstance As IRdsDictionaryInstance;
    Elements := Dict.Elements;
    //Increment index of the focused element by 1, because
    //in MDM dictionary zero element is root element
    //that corresponds to dictionary name
    Depends := Elements.Dependents(Elements.Element(DimensionTree1.FocusedElement + 1));
    //Collection of descriptions of objects that depend on element
    MDescs := Depends.Objects;
    For Each MDesc In MDescs Do
        Debug.WriteLine(MDesc.Name);
    End For;
End Sub Button1OnClick;

On clicking the button the collection of dependencies from MDM dictionary element focused in the DimensionTree1 component is obtained. Names of objects that depend on the element are displayed in the development environment console.

See also:

IRdsDictionaryElements