Before Delete Macro Event

The Before Delete event occurs when a record is deleted, but before the change is committed.

Note

The Before Delete event is available only in Data Macros.

Remarks

Use the Before Delete event to perform any actions that you want to occur before a record is deleted. The Before Change is comonly used to perform validation and to raise custom error messges.

You can use access a value in the record to be deleted by using the following syntax.

[Old].[Field Name]

For example, to access the value of the QuantityInStock field in the record to be deleted, use the following syntax.

[Old].[QuantityInStock]

The values contained in the record to be deleted are deleted permanently when the Before Delete event ends.

You can cancel the Before Delete event by using the RaiseError action. When an error is raised the changes contained in the Before Delete event are discarded.

The following table lists macro commands that can be used in theBefore Delete event.

Command Type

Command

Program Flow

Comment Macro Statement

Program Flow

Group Macro Statement

Program Flow

If...Then...Else Macro Block

Data Block

LookupRecord Macro Action

Data Action

ClearMacroError Macro Action

Data Action

OnError Macro Action

Data Action

RaiseError Macro Action

Data Action

SetLocalVar Macro Action

Data Action

StopMacro Macro Action

To create a Data macro that captures the Before Delete event, use the following steps.

  1. Open the table for which you want to capture the Before Delete event.

  2. On the Table tab, in the Before Events group, click Before Delete.