CurDate: IRdsParam;
The CurDate property returns a system parameter of a dictionary, which assignment is Relevance Date.
This parameter is available if the TimeDependent property is set to True, and it is used to filter elements, which actual period covers value of this 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;
ParamsVal: IRdsParamValues;
Dict: IRdsDictionary;
DictInst: IRdsDictionaryInstance;
Elements: IRdsDictionaryElements;
Element: IRdsDictionaryElement;
i: Integer;
Begin
MB := MetabaseClass.Active;
Dict := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Bind As IRdsDictionary;
ParamsVal := Dict.Params.CreateValues;
ParamsVal.CurDate := DateTime.ComposeDay(2008, 1, 1);
DictInst := Dict.Open(ParamsVal);
Elements := DictInst.Elements;
For i := 1 To Elements.Count - 1 Do
Element := Elements.Item(i);
Debug.WriteLine(Element.Name);
End For;
Debug.WriteLine("Next date");
ParamsVal.CurDate := DateTime.ComposeDay(2008, 5, 1);
DictInst := Dict.Open(ParamsVal);
Elements := DictInst.Elements;
For i := 1 To Elements.Count - 1 Do
Element := Elements.Item(i);
Debug.WriteLine(Element.Name);
End For;
End Sub Main;
After executing the example element names that are relevant in different period of times are displayed in the console.
See also: