IRdsAttributes.Version

Syntax

Version: IRdsAttribute;

Description

The Version property returns a system attribute of a dictionary, which assignment is Element Version.

Comments

This attribute has integer data type, cannot contain empty and multiple values. It is hidden by default. The attribute identifier is VERSION.

This attribute is available if the TimeDependent property is set to True, and it is used to fix changes in values of elements attributes.

Example

Executing the example requires the MDM repository NSI_1 that contains an MDM dictionary with the Dict_1 identifier. Element changes by time are set for a dictionary.

Sub Main;

Var

MB: IMetabase;

Dict: IRdsDictionary;

DictInst: IRdsDictionaryInstance;

Elements: IRdsDictionaryElements;

Attrs: IRdsAttributes;

Hist: IRdsDictionaryElementHistory;

i, j, InDate, OutDate, Ver, Name: Integer;

Begin

MB := MetabaseClass.Active;

Dict := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Bind As IRdsDictionary;

Dict.TimeDependent := True;

Attrs := Dict.Attributes;

InDate := Attrs.InDate.Key;

OutDate := Attrs.OutDate.Key;

Ver := Attrs.Version.Key;

Name := Attrs.Name.Key;

DictInst := Dict.Open(Null);

Elements := DictInst.Elements;

For i := 1 To Elements.Count - 1 Do

Hist := Elements.Item(i).History;

Debug.WriteLine(Elements.Item(i).Name);

For j := 0 To Hist.Count - 1 Do

Debug.Write(Start: + Hist.Attribute(j, InDate));

Debug.Write( Finish: + Hist.Attribute(j, OutDate));

Debug.Write( Version: + Hist.Attribute(j, Ver));

Debug.WriteLine( Value on this interval: + Hist.Attribute(j, Name));

End For;

End For;

End Sub Main;

After executing the example history of values of the Name attribute is displayed in the console for all dictionary elements.

See also:

IRdsAttributes