IMetabaseUpdateNode.Condition

Syntax

Condition: IExpression;

Description

The Condition property returns the condition, which execution results in the object update.

Example

Executing the example requires a repository object with the Form_1 identifier.

Sub UserProc;
Var
    MB: IMetabase;
    MU: IMetabaseUpdate;
    Prop: IMetabaseUpdateProperty;
    UFN: IMetabaseUpdateFolderNode;
    UpdObject: IMetabaseUpdateObjectNode;
Begin
    MB := MetabaseClass.Active;
    MU := MB.CreateUpdate;
    // Add a flag
    Prop := MU.Properties.Add;
    Prop.DataType := DbDataType.Integer;
    Prop.Id := "Flag1";
    Prop.Name := "Flag1";
    Prop.Value := 1;
    // Add an object
    UFN := MU.RootFolder;
    UpdObject := UFN.Add(MetabaseUpdateNodeType.Object) As IMetabaseUpdateObjectNode;
    UpdObject.Object := MB.ItemById("Form_1");
    UpdObject.Label := MB.ItemById("Form_1").Name;
    UpdObject.Condition.AsString := "Flag1 = 2";
    // Save update
    MU.SaveToFileNF("C:\Pef1.pefx");
End Sub UserProc;

After executing the example a new update is created. A flag used for setting update conditions will be created in the update, and the specified repository object will be added to the list of objects. This object will be assigned a condition, after which the update is saved to the C:\Pef1.pefx file.

See also:

IMetabaseUpdateNode