InitControlledParams(ObjKey: Integer; ObjParams: IMetabaseObjectParamValues);
InitControlledParams(ObjKey: uinteger; ObjParams: Prognoz.Platform.Interop.Metabase.IMetabaseObjectParamValues);
ObjKey. Key of the nested object which parameters values must be calculated.
ObjParams. Collection of parameters values where calculated values will be placed.
The InitControlledParams method calculates the expressions of the nested object parameters management.
On executing this method, parameters values, with which an embedded object can be opened while opening this object, are put in the ObjParams collection.
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;
ParentObj: IMetabaseObject;
DepDesc: IMetabaseObjectDescriptor;
Params: IMetabaseObjectParamValues;
Param: IMetabaseObjectParamValue;
Begin
MB := MetabaseClass.Active;
//Initial object
ParentObj := MB.ItemById("Obj_1").Bind;
//Nested object
DepDesc := ParentObj.Dependencies(False).Item(0);
Params := DepDesc.Params.CreateEmptyValues;
//Calculation of parameters with which the nested object is opened
ParentObj.InitControlledParams(DepDesc.Key, Params);
Debug.WriteLine("Nested object parameters");
For Each Param In Params Do
Debug.WriteLine("Parameter: " + Param.Id + "(" + Param.Name + "); Value: " + Param.Value);
End For;
End Sub UserProc;
After executing this example parameters values that are used to open embedded object while opening the source object Obj_1 are calculated. On calculation default parameters values of a source object are used. Names and values of the parameters of the nested object are displayed in the development environment console.
See also: