Add(NodeType: MetabaseUpdateNodeType): IMetabaseUpdateNode;
NodeType. Type of the update object to be created.
The Add method adds an object to the update structure.
Executing the example requires that the repository contains tables with the Table_1 and Table_2 identifiers and forms with the Form_1 and Form_2 identifiers.
Sub UserProc;
Var
MB: IMetabase;
Update: IMetabaseUpdate;
Root, Folder1, Folder2: IMetabaseUpdateFolderNode;
TableObj: IMetabaseUpdateDataObjectNode;
FormObj: IMetabaseUpdateObjectNode;
Begin
MB := MetabaseClass.Active;
Update := MB.CreateUpdate;
Root := Update.RootFolder;
// Create folders
Folder1 := Root.Add(MetabaseUpdateNodeType.Folder) As IMetabaseUpdateFolderNode;
Folder1.Label := "Tables";
Folder2 := Root.Add(MetabaseUpdateNodeType.Folder) As IMetabaseUpdateFolderNode;
Folder2.Label := "Forms";
// Add tables
TableObj := Folder1.Add(MetabaseUpdateNodeType.DataObject) As IMetabaseUpdateDataObjectNode;
TableObj.Object := MB.ItemById("Table_1");
TableObj.Label := TableObj.Object.Name;
TableObj.Method := MetabaseUpdateMethod.All;
TableObj := Folder1.Add(MetabaseUpdateNodeType.DataObject) As IMetabaseUpdateDataObjectNode;
TableObj.Object := MB.ItemById("Table_2");
TableObj.Label := TableObj.Object.Name;
TableObj.Method := MetabaseUpdateMethod.All;
// Add forms
FormObj := Folder2.Add(MetabaseUpdateNodeType.Object) As IMetabaseUpdateObjectNode;
FormObj.Object := MB.ItemById("Form_1");
FormObj.Label := FormObj.Object.Name;
FormObj := Folder2.Add(MetabaseUpdateNodeType.Object) As IMetabaseUpdateObjectNode;
FormObj.Object := MB.ItemById("Form_2");
FormObj.Label := FormObj.Object.Name;
Update.SaveToFileNF("c:\Object.pefx");
End Sub UserProc;
After executing the example a new update is created. Two tables and two forms are included in the update. Two folders are created in the update structure to arrange objects.
See also: