WriteUpdate(Update: IMetabaseUpdate; Mode: UpdateLoadMode);
Update. Update that will be saved.
Mode. Mode of adding objects to update.
The WriteUpdate method saves update as a repository object.
To execute the example, add a link to the Metabase system assembly. An update with the ObjPefx identifier, a table with the Table identifier and a form with the Form_1 identifier should exist in the repository.
Sub UserProc;
Var
MB: IMetabase;
Update: IMetabaseUpdate;
Root: IMetabaseUpdateFolderNode;
TableObj: IMetabaseUpdateDataObjectNode;
Obj: IMetabaseUpdateObjectNode;
UpdateObj: IMetabaseUpdateObject;
Begin
MB := MetabaseClass.Active;
Update := MB.CreateUpdate;
Root := Update.RootFolder;
TableObj := Root.Add(MetabaseUpdateNodeType.Object) As IMetabaseUpdateDataObjectNode;
TableObj.Object := MB.ItemById("Table");
TableObj.Method := MetabaseUpdateMethod.All;
TableObj.Label := TableObj.Object.Name;
Obj := Root.Add(MetabaseUpdateNodeType.Object) As IMetabaseUpdateObjectNode;
Obj.Object := MB.ItemById("Form_1");
UpdateObj := MB.ItemById("ObjPefx").Bind As IMetabaseUpdateObject;
UpdateObj.WriteUpdate(Update, UpdateLoadMode.InsertUpdate);
End Sub UserProc;
After executing the example a table and a form are added to the update in the repository. If these objects were already contained in the update, they will be replaced.
See also: