RegisterIdChange(ClassId: Integer; OldId: String; NewId: String; newObject: IMetabaseObject);
ClassId. The identifier of the consumer repository class, to which the update object refers.
OldId. The identifier of the consumer repository object, to which the object refers before updating.
NewId. The identifier of the consumer repository object, to which the object refers after update.
newObject. The consumer repository object, to which the object refers after updating.
The RegisterIdChange method redetermines the identifier of the object, to which the update object refers.
The RegisterIdChange method redetermines the object, to which the update object refers, by replacing identifiers.
If you specify the non-existing identifier or object as the NewId or newObject parameter, the repository object is updated without reconfiguring links.
One of available values of the MetabaseObjectClass is specified as the value of the ClassId parameter.
Executing the example requires the C:\Update.pefx update file and the object with the BD2 identifier in the repository. Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
Update: IMetabaseUpdate;
UpdateCxt: IMetabaseUpdateContext;
NewObject: IMetabaseObject;
Begin
MB := MetabaseClass.Active;
Update := MB.CreateUpdate;
Update.LoadFromFileNF("C:\Update.pefx");
UpdateCxt := Update.CreateUpdateContext;
NewObject := Mb.ItemById("BD2").Bind As IMetabaseObject;
UpdateCxt.RegisterIdChange(NewObject.ClassId, "BD1", "BD2", NewObject);
Update.ApplyEx(Null, UpdateCxt);
End Sub UserProc;
After executing the example the destination repository objects are updated, the update is loaded from the C:\Update.pef file. The link of the updated object will be redetermined to the object of the consumer repository with the BD2 identifier.
See also: