ParamsControl(Link: IRdsLinkInstance): IRdsParamsControlInstance;
Link - link with a dictionary, which parameters are necessary to control.
The ParamsControl property returns an object that controls parameter values of a linked dictionary by changing attribute values of the current dictionary.
Executing the example requires the MDM repository NSI_1 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. A linked dictionary includes one parameter, which values are controlled by the FOR_PARAM attribute of the Dict_1 dictionary.
Sub Main;
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 Main;
After executing the example a new element is created in the Dict_1 dictionary. The first element from a linked dictionary opened with parameter value 1 is chosen as value of the attribute ATTRIBUTE.
See also: