ICalcAlgorithm.ObjectParamsControl

Syntax

ObjectParamsControl: IAlgoObjectsParamsControl;

Description

The ObjectParamsControl property returns repository object parameter control settings.

Comments

Parameter control settings are available for the repository objects that are added in the calculation algorithm working area and have parameters created based on dictionaries.

Example

Executing the example requires that the repository contains a calculation algorithm with the ALGORITHM identifier. The algorithm has two parameters with the START_DATE and END_DATE identifiers. The algorithm has a data entry form with the DATA_ENTRY_FORM identifier that has two parameters created based on the same dictionaries that were used to create calculation algorithm parameters.

Add links to the Algo, Metabase, Ms system assemblies. Add a link to the assembly required for working with calculation algorithm.

Sub UserProc;
Var
    MB: IMetabase;
    MObj, RepoObj: IMetabaseObjectDescriptor;
    Algo: ICalcObject;
    CalcAlgo: ICalcAlgorithm;
    ObjectsParamsControl: IAlgoObjectsParamsControl;
    ParamsControl: IAlgoObjectParamsControl;
    ParamControl: IAlgoObjectParamControl;
Begin
    MB := MetabaseClass.Active;
    // Get calculation algorithm
    MObj := MB.ItemById("ALGORITHM");
    Algo := CalcObjectFactory.CreateCalcObject(MObj, True);
    CalcAlgo := Algo As ICalcAlgorithm;
    // Description of parametric repository object added in calculation algorithm
    RepoObj := MB.ItemById("DATA_ENTRY_FORM");
    // Repository object parameter control settings
    ObjectsParamsControl := CalcAlgo.ObjectParamsControl;
    ParamsControl := ObjectsParamsControl.FindByKey(RepoObj.Key);
    If IsNull(ParamsControl) Then
        ParamsControl := ObjectsParamsControl.Add(RepoObj);
    End If;
    ParamsControl.Clear;
    // Add parameters and set up links
    ParamControl := ParamsControl.Add(RepoObj.Params.Item(0));
    ParamControl.AlgParam := Algo.Params.FindById("START_DATE");
    ParamControl := ParamsControl.Add(RepoObj.Params.Item(1));
    ParamControl.AlgParam := Algo.Params.FindById("END_DATE");
    // Save changes
    Algo.SaveObject;
End Sub UserProc;

After executing the example, parameter control will be set up for the repository object added in the calculation algorithm's working area.

See also:

ICalcAlgorithm