Deletes all records in a table that fall within a specified range.
Record.DELETEALL([RunTrigger]) |
Parameters
- Record
- Type: Record Identifies the table in which the deletion will occur. Only those records selected by the filters set for Record are deleted.
- RunTrigger
- Type: Boolean Specifies whether to run the C/AL code in the OnDelete Trigger. If this parameter is true, then the code in the OnDelete trigger will be executed. If this parameter is false, then the code in the OnDelete trigger will not be executed. The default value is false.
Example
This example requires that you create a Record variable for the Customer table named CustomerRec.
Copy Code | |
---|---|
// This C/AL code: WHILE CustomerRec.FIND('-') DO CustomerRec.DELETE; // Performs the same operation as: CustomerRec.DELETEALL; |
When RunTrigger is false (the default), the DELETEALL function in this example is much faster than the DELETE function because it requires only one call to the server, while the first method requires multiple calls. If RunTrigger is true, then there will not be any gain in performance because each record needs to be loaded to the client anyway in order to execute the OnDelete trigger.