ReferenceDictionary: IRdsDictionaryInstance;
The ReferenceDictionary property returns data of the linked dictionary, which parameters are controlled.
Data is returned with values of attributes used to control parameters.
Executing the example requires an MDM repository with the NSI_1 identifier that contains an MDM dictionary with the Dict_1 identifier. The dictionary includes the link with any other MDM dictionary. An attribute with the ATTRIBUTE identifier is a linked attribute. The linked dictionary has one parameter with its values controlled by the FOR_PARAM attribute of the Dict_1 dictionary.
Sub Macro;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Dict: IRdsDictionary;
Attr: IRdsAttributes;
Inst, Inst1: IRdsDictionaryInstance;
Data: IRdsDictionaryElementData;
ParamContrInst: IRdsParamsControlInstance;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Bind;
Dict := MObj As IRdsDictionary;
Inst := MObj.Open(Null) As IRdsDictionaryInstance;
Attr := Dict.Attributes;
Data := Inst.CreateElementData;
Data.Attribute(Attr.FindById("FOR_PARAM").Key) := 1;
ParamContrInst := Data.ParamsControl(Inst.Links.Item(0));
Inst1 := ParamContrInst.ReferenceDictionary;
Data.Attribute(Attr.FindById("ATTRIBUTE").Key) := Inst1.Elements.Item(1).Key;
Data.Attribute(Attr.Name.Key) := "New";
Inst.Insert(2, Data);
End Sub Macro;
After executing the example a new element is created in the Dict_1 dictionary. The first element from the linked dictionary opened with the parameter value 1 is chosen as the ATTRIBUTE attribute value.
See also: