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

By default the property is set to False 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.

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