PreserveExistingData: Boolean;
The PreserveExistingData property determines whether the data, that is present in the updated consumer object and not present in the source object, is removed on the update.
If the property is set to True, the records/elements, that are absent in the source object, are preserved in the updated object. The default property value is False, beside that the consumer object is cleared before the update.
NOTE. The property is outdated, use BatchMode instead.
Executing the example requires that the repository contains a table with the Table_1 identifier. The table contains the Field1 field, which values are used to search for existing records.
Sub Main;
Var
MB: IMetabase;
MBDesc: IMetabaseObjectDescriptor;
MUpdate: IMetabaseUpdate;
ObjNode: IMetabaseUpdateDataObjectNode;
Begin
MB := MetabaseClass.Active;
//The updated table
MBDesc := MB.ItemById("Table_1");
MUpdate := MB.CreateUpdate;
ObjNode := MUpdate.RootFolder.Add(MetabaseUpdateNodeType.DataObject) As IMetabaseUpdateDataObjectNode;
ObjNode.Label := MBDesc.Id;
ObjNode.Method := MetabaseUpdateMethod.All;
ObjNode.Object := MBDesc;
ObjNode.PreserveExistingData := True;
ObjNode.PrimaryKey := "FIELD1";
MUpdate.SaveToFileNF("c:\Table.pefx");
End Sub Main;
After executing this example a new update is created. The update will contain the Table_1 table. During the consumer table data update, the data, that is not present in the source table, is not deleted. The search for the updated records is performed by the FIELD1 field value.
See also: