IMetabaseObjectDescriptor.TrackElementDependencies

Fore Syntax

TrackElementDependencies: Boolean;

Fore.NET Syntax

TrackElementDependencies: Boolean;

Description

The TrackElementDependencies property indicates whether the object dependencies on the MDM dictionary elements are tracked.

Comments

If the property is set to True, dependency on the elements of the MDM dictionaries are tracked for the object. Information about dependencies can be received in the ElementDependencies property.

If this property is changed, the ElementDependenciesTrackingType property is changed automatically.

Example

Executing the example requires that the repository contains an object with the Obj_1 identifier and an MDM dictionary with the Country identifier in repository. The object supports tracking of dependencies on the elements of dictionaries. The dictionary is stored in the MDM repository with the RDS identifier.

Sub UserProc;
Var
    MB: IMetabase;
    Obj, Dictionary: IMetabaseObjectDescriptor;
    Elements: IRdsDictionaryElements;
    Depends: IMbElementDependencies;
    Template: IMbElementDependencyTemplate;
Begin
    MB := MetabaseClass.Active;
    Obj := MB.ItemById("Obj_1");
    Dictionary := MB.ItemByIdNamespace("Country", MB.ItemById("RDS").Key);
    Elements := (Dictionary.Open(NullAs IRdsDictionaryInstance).Elements;
    //Change settings to use tracking of dependencies
    Obj := Obj.EditDescriptor;
    Obj.TrackElementDependencies := True;
    Obj.SaveDescriptor;
    //Change settings to use tracking of references to elements of the dictionary
    Dictionary := Dictionary.EditDescriptor;
    Dictionary.TrackElementDependents := True;
    Dictionary.SaveDescriptor;
    //New template for adding the dependency
    //A pattern is created for the first element of MDM dictionary
    Template := New MbElementDependencyTemplateClass.Create(
        Obj.Key, Dictionary.Key, Elements.Element(1));
    //A collection of object dependencies
    Depends := Obj.ElementDependencies;
    Depends.Add(Template);
    Mb.ElementDependenciesDatabase.Update(Depends);
End Sub UserProc;

After executing this example the function of tracking of the dependencies on the elements of the dictionary is activated for the specified object and for the MDM dictionary. A new dependency from the first element of a dictionary will be created for an object. A list of dependencies is saved in the repository base.

See also:

IMetabaseObjectDescriptor