IMetabaseUpdateDataObjectNode.IsIdentity

Fore Syntax

IsIdentity: Boolean;

Fore.NET Syntax

IsIdentity: Boolean;

Description

The IsIdentity property determines whether the data of the table, that contains the Identity field, is updated correctly.

Comments

The default property value is False and when the table with the Identity field is attempted to be updated an error is generated. For correct update of the table, that contains  the Identity field, assign to the property the True value. If the table contains the Identity fields, then the IsIdentity property must be assigned the False value to.

This 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.

Fore Example

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 this example file of update is created. On the update performing  the table data is correctly updated.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Public Shared Sub Main(Params: StartParams);
Var
    Mb: IMetabase;
    MBDesc: IMetabaseObjectDescriptor;
    MUpdate: IMetabaseUpdate;
    ObjNode: IMetabaseUpdateDataObjectNode;
Begin
    Mb := Params.Metabase;
    MBDesc := MB.ItemById["Table_1"];
    MUpdate := MB.CreateUpdate();
    ObjNode := MUpdate.RootFolder.Add(MetabaseUpdateNodeType.untDataObject) As IMetabaseUpdateDataObjectNode;
    ObjNode.Label := MBDesc.Id;
    ObjNode.Method := MetabaseUpdateMethod.mumAll;
    ObjNode.Object := MBDesc;
    ObjNode.BatchMode := ObjectUpdateDataBatchMode.obupdabamoUpdateInsert;
    ObjNode.IsIdentity := True;
    MUpdate.SaveToFileNF("c:\Update.pefx");
End Sub;

After executing this example file of update is created. On installing the update the table data is correctly updated.

See also:

IMetabaseUpdateDataObjectNode