WriteUpdate(Update: IMetabaseUpdate; Mode: UpdateLoadMode);
WriteUpdate(Update: Prognoz.Platform.Interop.Metabase.IMetabaseUpdate; Mode: Prognoz.Platform.Interop.Metabase.UpdateLoadMode);
Update. Update that is saved.
Mode. Mode of adding the objects to the update.
The WriteUpdate method saves update as a repository object.
To execute the example, add a link to the Metabase system assembly. 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 placed in the repository. If these objects were already contained in the update, they would be replaced.
Update with the ObjPefx identifier, a table with the Table identifier and a form with the Form_1 identifier should exist in the repository. The specified procedure is an entry point for the .NET assembly.
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Update: IMetabaseUpdate;
Root: IMetabaseUpdateFolderNode;
TableObj: IMetabaseUpdateDataObjectNode;
Obj: IMetabaseUpdateObjectNode;
UpdateObj: IMetabaseUpdateObject;
Begin
MB := Params.Metabase;
Update := MB.CreateUpdate();
Root := Update.RootFolder;
TableObj := Root.Add(MetabaseUpdateNodeType.untObject) As IMetabaseUpdateDataObjectNode;
TableObj.Object := MB.ItemById["Table"];
TableObj.Method := MetabaseUpdateMethod.mumAll;
TableObj.Label := TableObj.Object.Name;
Obj := Root.Add(MetabaseUpdateNodeType.untObject) As IMetabaseUpdateObjectNode;
Obj.Object := MB.ItemById["Form_1"];
UpdateObj := MB.ItemById["ObjPefx"].Bind() As IMetabaseUpdateObject;
UpdateObj.WriteUpdate(Update, UpdateLoadMode.ulmInsertUpdate);
End Sub;
After executing the example a table and a form are added to the update placed in the repository. If these objects were already contained in the update, they would be replaced.
See also: