IRdsLinkInstance.ParamsControl

Syntax

ParamsControl(Data: IRdsDictionaryElementData): IRdsParamsControlInstance;

Parameters

Data - attribute values that are used to control parameters of a linked dictionary.

Description

The ParamsControl property returns an object that controls parameter values of a linked dictionary by changing attribute values of the current dictionary.

Example

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 := Inst.Links.Item(0).ParamsControl(Data);

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:

IRdsLinkInstance