IRdsLink.ParamsControl

Syntax

ParamsControl: IRdsParamsControl;

Description

The ParamsControl property returns settings of parameter binding. This property is relevant if connection with the parametric dictionary is executed.

Example

Executing the example requires the MDM repository NSI_1 that contains MDM dictionaries with the Dict_1 and Dict_2 identifiers. The second dictionary has one parameter.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Dict, Dict2: IRdsDictionary;
    Attrs: IRdsAttributes;
    LinkAttr, ParamAttr: IRdsAttribute;
    Link: IRdsLink;
    Param: IRdsParam;
    ParamsControl: IRdsParamsControl;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Edit;
    Dict := MObj As IRdsDictionary;
    Dict2 := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Bind As IRdsDictionary;
    //Attributes of the first dictionary
    Attrs := Dict.Attributes;
    //Attribute to link with the dictionary
    LinkAttr := Attrs.Add;
    LinkAttr.DataType := DbDataType.Integer;
    LinkAttr.Id := "LinkAttr";
    LinkAttr.Name := Attribute to link;
    //Link with parametric dictionary
    Link := Dict.Links.Add;
    Link.Attribute := LinkAttr;
    Link.Reference := Dict2.Attributes.Key;
    Link.Id := "Link";
    Link.Name := Link with the dictionary Dict_2;
    //Parameter that should be controlled
    ParamsControl := Link.ParamsControl;
    Param := ParamsControl.ReferenceDictionary.Params.Item(0);
    //Attribute to link with the dictionary
    ParamAttr := Attrs.Add;
    ParamAttr.DataType := Param.Attribute.DataType;
    ParamAttr.Id := "ParamAttr";
    ParamAttr.Name := "Parameter control";
    //Attribute binding to second dictionary parameter
    ParamsControl.ParamAttribute(Param) := ParamAttr;
    MObj.Save;
End Sub UserProc;

After executing the example two attributes are created in the first dictionary: the first one is used to connect with the Dict_2 dictionary; the second one is used to control parameter values of the Dict_2 dictionary. Connection is set up between the Dict_1 and Dict_2 dictionaries by the Key attribute, the ParamAttr attribute is used to control parameter values of the linked Dict_2 dictionary.

See also:

IRdsLink