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 |
|
Program Flow |
|
Program Flow |
|
Data Block |
|
Data Action |
|
Data Action |
|
Data Action |
|
Data Action |
|
Data Action |
To create a Data macro that captures the Before Delete event, use the following steps.
Open the table for which you want to capture the Before Delete event.
On the Table tab, in the Before Events group, click Before Delete.