ForceUpdateObject: IMetabaseObject;
ForceUpdateObject: Prognoz.Platform.Interop.Metabase.IMetabaseObject;
The ForceUpdateObject property determines repository object to that update is performed not depending on settings that are set for an object in the update.
On executing preparation for performing update for objects the ApplyState property is assigned. Particularly, the repository object, to which update is performed if an object exists in repository, is available in the UpdateObject property. Search of this object is performed in accordance with settings specified in update. The updated object can be changed in the custom OnBeforeApplyUpdate event used in update module through the UpdateObject property. If use of update module is not foreseen, the repository object, to which it is necessary to apply update, may be specified using this property.
NOTE. An object that has the same class as an object in update has must be specified as updated object.
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. Any form is included in 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(0) As IMetabaseUpdateObjectNode).ApplyState;
AplyState.ForceUpdateObject := MB.ItemById("Temp_Form").Bind;
Update.Apply;
End Sub UserProc;
On executing the example update from a specified file is downloaded. Before applying update settings are changed. Repository form necessary to update is specified for a form in update.
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. Any form is included in update. This example is an entry point for any .NET assembly.
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Update: IMetabaseUpdate;
AplyState: IMetabaseUpdateObjectApplyState;
Begin
MB := Params.Metabase;
Update := Mb.CreateUpdate();
Update.LoadFromFile("C:\Form.pef", UpdateLoadMode.ulmInsertUpdate);
AplyState := (Update.RootFolder.Item[0] As IMetabaseUpdateObjectNode).ApplyState;
AplyState.ForceUpdateObject := MB.ItemById["Temp_Form"].Bind();
Update.Apply(Null);
End Sub;
On executing the example update from a specified file is downloaded. Before applying update settings are changed. Repository form necessary to update is specified for a form in update.
See also: