IMetabaseObjectInstance.InitControlledParams

Syntax

InitControlledParams(ObjKey: Integer; ObjParams: IMetabaseObjectParamValues);

Parameters

ObjKey. Key of the nested object which parameters values must be calculated.

ObjParams. Collection of parameters values where calculated values will be placed.

Description

The InitControlledParams method calculates the expressions of the nested object parameters management.

Comments

On executing the method the values of parameters with which the nested object is opened when opening this object are placed in the ObjParams collection.

Example

Executing the example requires an object with the Obj_1 identifier that contains one parameter. This object is based on any additional object for which the parameters management was set.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    ParentDesc, DepDesc: IMetabaseObjectDescriptor;
    Params, Params1: IMetabaseObjectParamValues;
    Param: IMetabaseObjectParamValue;
    ObjInst: IMetabaseObjectInstance;
Begin
    MB := MetabaseClass.Active;
    //Source object
    ParentDesc := MB.ItemById("Obj_1");
    Params := ParentDesc.Params.CreateEmptyValues;
    Params.Item(0).Value := 2;
    //Opening of the initial object
    ObjInst := ParentDesc.Open(Params);
    //Nested object
    DepDesc := ParentDesc.Dependencies(False).Item(0);
    Params1 := DepDesc.Params.CreateEmptyValues;
    //Calculation of parameters with which the nested object is opened
    ObjInst.InitControlledParams(DepDesc.Key, Params1);
    Debug.WriteLine("Nested object parameters");
    For Each Param In Params1 Do
    Debug.WriteLine("Parameter: " + Param.Id + "(" + Param.Name + "); Value: " + Param.Value);
    End For;
End Sub UserProc;

After executing the example the object with the specified value of the parameter is opened. After opening the values of parameters with which the nested object is opened, are calculated. Names and values of the parameters of the nested object are displayed in the development environment console.

See also:

IMetabaseObjectInstance