Item(Index: Integer): IRdsDictionaryElementData;
Index. Record index in a history of element changes.
The Item property returns data from a history of an element. Record index is passed by the Index parameter.
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;
Hist: IRdsDictionaryElementHistory;
Data: IRdsDictionaryElementData;
Attrs: IRdsAttributes;
i, InDate, OutDate: Integer;
Begin
MB := MetabaseClass.Active;
Dict := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Bind As IRdsDictionary;
Attrs := Dict.Attributes;
InDate := Attrs.InDate.Key;
OutDate := Attrs.OutDate.Key;
DictInst := Dict.Open(Null);
Elements := DictInst.Elements;
Hist := Elements.History(Elements.Item(1).Key);
For i := 0 To Hist.Count - 1 Do
Data := Hist.Item(i);
Debug.Write(Start date: + Data.Attribute(InDate));
Debug.WriteLine( Finish date: + Data.Attribute(OutDate));
End For;
End Sub Main;
After executing the example start dates and action finish of all versions of the first root element of the MDM dictionary are displayed in console.
See also: