ICalcBlockIteratorModel.IsDirty

Syntax

IsDirty: Boolean;

Description

The IsDirty property returns whether there are changes in data sources settings.

Comments

Available values:

Example

Executing the example requires that the repository contains a calculation algorithm with the ALGORITHM identifier. A calculation block is created and set up in the algorithm.

Add links to the Algo, Metabase system assemblies. Add links to the assemblies required for working with calculation algorithms.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObjectDescriptor;
    Algo: ICalcObject;
    CalcAlgo: ICalcAlgorithm;
    CalcBlock: ICalcBlock;
    CalcBlockIteratorModel: ICalcBlockIteratorModel;
    CalcBlockIteratorStub: ICalcBlockIteratorStub;
Begin
    MB := MetabaseClass.Active;
    // Get calculation algorithm
    MObj := MB.ItemById("ALGORITHM");
    Algo := CalcObjectFactory.CreateCalcObject(MObj, True);
    CalcAlgo := Algo As ICalcAlgorithm;
    // Calculation block
    CalcBlock := CalcAlgo.Items(0As ICalcBlock;
    CalcBlockIteratorModel := CalcBlock.EditIteratorModel;
    CalcBlockIteratorStub := CalcBlockIteratorModel.Stubs.Item(0);
    // Link of source and consumer dimensions by attribute identifiers
    CalcBlockIteratorStub.LinkById;
    // If there are changes in settings, save calculation block
    If CalcBlockIteratorModel.IsDirty Then
        CalcBlockIteratorModel.Save;
        CalcBlockIteratorModel.Dispose_;
        CalcBlock.SaveObject;
    End If;
End Sub UserProc;

After executing the example, a link between source and consumer dimensions by identifiers will be set in the calculation block. If there are changes, the calculation block will be saved.

See also:

ICalcBlockIteratorModel