IMetabaseUpdateObjectApplyState.ForceUpdateObject

Syntax

ForceUpdateObject: IMetabaseObject;

Description

The ForceUpdateObject property determines a repository object that will be updated regardless of the settings determined for an object in the update.

Comments

When objects are prepared to be updated, the ApplyState property is set for them. Particularly, the repository object, which will be updated if the object exists in repository, is available in the UpdateObject property. This object is searched according to the settings specified in the update. The updated object can be changed in the OnBeforeApplyUpdate custom event used in update unit via the UpdateObject property. If the update unit is not assumed to be used, the repository object that should be updated can be specified using this property.

NOTE. An object of the same class as an object in update has must be specified as an updated object.

Example

Executing the example requires that the repository contains a form with the Temp_Form identifier. The root of disc C contains the update file MainForm.Pef. A form is included in the update.

Sub UserProc;
Var
    MB: IMetabase;
    Update: IMetabaseUpdate;
    AplyState: IMetabaseUpdateObjectApplyState;
Begin
    MB := MetabaseClass.Active;
    Update := Mb.CreateUpdate;
    Update.LoadFromFile("C:\Form.pef");
    AplyState := (Update.RootFolder.Item(0As IMetabaseUpdateObjectNode).ApplyState;
    AplyState.ForceUpdateObject := MB.ItemById("Temp_Form").Bind;
    Update.Apply;
End Sub UserProc;

On executing the example the update from the specified file is downloaded. The update options are changed before applying the update. A repository form that should be updated is specified for a form in the update.

See also:

IMetabaseUpdateObjectApplyState