Show contents 

Ms > Ms Assembly Interfaces > IMsUserTransform > IMsUserTransform.ForeMethod

IMsUserTransform.ForeMethod

Syntax

ForeMethod: IForeMethod;

Description

The ForeMethod property determines the global custom method used for model calculation.

Comments

If the global custom method is determined, values of the IMsUserTransform.Assembly and IMsUserTransform.ClassName properties are reset.

Example

Executing the example requires the global parameters area that contains custom methods. The repository should also include a modeling container with the CONT_MODEL identifier that contains a model with the MODEL identifier.

Add links to the Fore, Metabase, Ms system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    Shp: ISharedParams;
    contModel: IMetabaseObjectDescriptor;
    model: IMsModel;
    formula: IMsFormula;
    userM: IMsUserTransform;
    transform: IMsFormulaTransform;
    f: IForeMethod;
Begin
    mb := MetabaseClass.Active;
    contModel := mb.ItemById("CONT_MODEL");
    model := mb.ItemByIdNamespace("MODEL", contModel.Key).Edit As IMsModel;
    transform := model.Transform;
    formula := transform.FormulaItem(0);
    formula.Kind := MsFormulaKind.User;
    userM := formula.Method As IMsUserTransform;
    Shp := mb.SpecialObject(MetabaseSpecialObject.SharedParams).Bind As ISharedParams;
    f := Shp.Methods.Item(0);
    userM.ForeMethod := f;
    (model As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the MODEL model uses the first custom method from global parameters area for calculation.

See also:

IMsUserTransform