IRdsDictionaryElementDependents.SelectAllWithChildren

Syntax

SelectAllWithChildren: IMbElementDependencies;

Description

The SelectAllWithChildren method returns a collection of dependencies for the Element element and all its child elements.

Example

Executing the example requires an MDM repository with the RDS identifier. The MDM dictionary with the Country identifier is created in this repository. Tracking links to elements is enabled for a dictionary.

Sub UserProc;
Var
    MB: IMetabase;
    Dict: IRdsDictionary;
    Elements: IRdsDictionaryElements;
    Depends: IRdsDictionaryElementDependents;
    MBDepend: IMbElementDependencies;
Begin
    MB := MetabaseClass.Active;
    Dict := MB.ItemByIdNamespace("Country", MB.GetObjectKeyById("RDS")).Bind As IRdsDictionary;
    Elements := (Dict.Open(NullAs IRdsDictionaryInstance).Elements;
    Depends := Elements.Dependents(Elements.Element(1));
    If Not Depends.IsEmptyWithChildren Then
        MBDepend := Depends.SelectAllWithChildren;
        MBDepend.Database.Delete(MBDepend.Where);
    End If;
End Sub UserProc;

On executing the example availability of dependencies on the specified element and all its child elements of the MDM dictionary is checked. If any dependencies exist, they are removed.

See also:

IRdsDictionaryElementDependents