IMetabaseUpdateUserEvents.OnAskConstraintsHandling

Syntax

OnAskConstraintsHandling(

Update: IMetabaseUpdate;

Node: IMetabaseUpdateNode;

Details: String;

Var Handling: UpdateDataConstraintsHandlingType);

Parameters

Update - update used in current repository.

Node - an update object for which the event was generated.

Details - the information about the error.

Handling - the variable that determines the way of integrity constraint processing.

Description

The OnAskConstraintsHandling method implements an event that occurs if it is necessary to process constraint of the data integrity of the object that is updated.

Example

Public Class CUpdateEvents: UpdateEvents

Public Sub OnBeginUpdate(Update: IMetabaseUpdate);

Var

Flag: IMetabaseUpdateProperty;

Begin

Debug.WriteLine("Update of repository objects");

Flag := Update.Properties.FindById("Ver");

If Flag <> Null Then

Flag.Value := "1.1";

End If;

End Sub OnBeginUpdate;

 

Public Sub OnAskConstraintsHandling(Update: IMetabaseUpdate; Node: IMetabaseUpdateNode;

Details: String;

Var Handling: UpdateDataConstraintsHandlingType);

Begin

Handling := UpdateDataConstraintsHandlingType.KeepTableUnchanged;

End Sub OnAskConstraintsHandling;

 

Public Sub OnAskReflectRights(Var Cancel: Boolean);

Begin

Cancel := True;

End Sub OnAskReflectRights;

 

Public Sub OnUpdateObject(Update: IMetabaseUpdate; CurrentNode: IMetabaseUpdateNode; Var Skip: Boolean);

Begin

If CurrentNode.NodeType = MetabaseUpdateNodeType.DeleteObject Then

Skip := True;

End If;

End Sub OnUpdateObject;

 

Public Sub OnEndUpdate(Update: IMetabaseUpdate);

Begin

Debug.WriteLine("Update of objects is completed");

End Sub OnEndUpdate;

End Class CUpdateEvents;

This example is a template for update module. On applying of update that contains this module the following checks are performed:

See also:

IMetabaseUpdateUserEvents