Condition: IExpression;
The Condition property returns a condition with the execution of which the object is updated.
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;
//adding a flag
Prop := MU.Properties.Add;
Prop.DataType := DbDataType.Integer;
Prop.Id := "Flag1";
Prop.Name := "Flag1";
Prop.Value := 1;
//adding 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";
//saving an update
MU.SaveToFileNF("C:\Pef1.pefx");
End Sub Main;
After executing this example a new update is created. A flag, used for assigning update conditions, will be created in the update, and a repository object with the Form_1 identifier will be added to an objects list. This object will be assigned a condition, after that the update is saved into the C:\Pef1.pefx file.
See also: