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 Main;

Var

MB: IMetabase;

MU: IMetabaseUpdate;

Prop: IMetabaseUpdateProperty;

UFN: IMetabaseUpdateFolderNode;

Object: 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;

Object := UFN.Add(MetabaseUpdateNodeType.Object) As IMetabaseUpdateObjectNode;

Object.Object := MB.ItemById("Form_1");

Object.Label := MB.ItemById("Form_1").Name;

Object.Condition.AsString := "Flag1 = 2";

//save update

MU.SaveToFileNF("C:\Pef1.pefx");

End Sub Main;

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

See also:

IMetabaseUpdateNode