An update unit is used to trace the events occurring when an update is applied. One of the development environment units contained in the update can be set as update unit.
To create a condition of a certain operation specified in the update unit, variables of the update flag are used.
To set the update unit, select the Set as Update Unit item in the unit's context menu on the Update panel.
The update unit should be positioned at the beginning of the update objects list. After declaring the update unit, the system requests to change its position in the update structure.
The body of this unit must contain the CUpdateEvents class inherited from the UpdateEvents class and containing the implementation of its methods, for example:
Public Class CUpdateEvents: UpdateEvents
// //Starting update
Public Sub OnBeginUpdate(Update: IMetabaseUpdate);
Begin
End Sub OnBeginUpdate;
// Check whether objects are ready for update
Public Sub OnBeforeApplyUpdate(Update: IMetabaseUpdate);
Begin
End Sub OnBeforeApplyUpdate;
// Processing data integrity issues
Public Sub OnAskConstraintsHandling(Update: IMetabaseUpdate; Node: IMetabaseUpdateNode;
Details: String;
Var Handling: UpdateDataConstraintsHandlingType);
Begin
End Sub OnAskConstraintsHandling;
// Updating permissions
Public Sub OnAskReflectRights(Var Cancel: Boolean);
Begin
End Sub OnAskReflectRights;
// Updating objects
Public Sub OnUpdateObject(Update: IMetabaseUpdate; CurrentNode: IMetabaseUpdateNode;
Var Skip: Boolean);
Begin
End Sub OnUpdateObject;
// Update end
Public Sub OnEndUpdate(Update: IMetabaseUpdate);
Begin
End Sub OnEndUpdate;
End Class CUpdateEvents;
It is possible to view unit text.
NOTE. On separating administrator roles unit text cannot be viewed by information security administrator (ISA).
See also: