IsIdentity: Boolean;
The IsIdentity property determines whether the data of the table that contains the Identity field is updated correctly.
The property is set to False by default, and the error will be generated on updating the table with the Identity field. To correctly update the table with the Identity field, set the property to True. If the table has no Identity field, the IsIdentity property must be set to False.
The setting is relevant only for the tables and MDM dictionaries.
On working with the update using the update manager the property value is set automatically.
Executing the example requires that the repository contains a table with the Table_1 identifier containing the Identity field. Add a link to the Metabase system assembly.
Sub UserProc;
Var
Mb: IMetabase;
MBDesc: IMetabaseObjectDescriptor;
MUpdate: IMetabaseUpdate;
ObjNode: IMetabaseUpdateDataObjectNode;
Begin
Mb := MetabaseClass.Active;
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.BatchMode := ObjectUpdateDataBatchMode.UpdateInsert;
ObjNode.IsIdentity := True;
MUpdate.SaveToFileNF("c:\Update.pefx");
End Sub UserProc;
After executing the example an update file is created. When this update is installed, the table data is correctly updated.
See also: