# RecordRef.DeleteAll([Boolean]) Method
> Version: _Available or changed with runtime version 1.0._
Deletes all records in a table that fall within a specified range.
## Syntax
```al
 RecordRef.DeleteAll([RunTrigger: Boolean])
```
## Parameters
RecordRef
Type: recordref-data-type
An instance of the recordref-data-type data type.
*[Optional] RunTrigger*
Type: ../boolean/boolean-data-type
Specifies whether the code in the OnDelete trigger will be executed. If this parameter is true, the code will be executed. If this parameter is false (default), the code will not be executed. This parameter is optional.
## Remarks
This method works the same way as the DeleteAll Method \(Record\)<../library>.
## Example
The following example opens table 18 \(Customer\) as a RecordRef variable that is named CustomerRecRef. The recordref-field-method creates a FieldRef variable that is named MyFieldRef for field 1 \(No.\). From the No. field, the ../fieldref/fieldref-setrange-method selects records in the range from 10000 to 20000. The number of records in the range is displayed in a message box. The DeleteALL method deletes all records in that range. The number of records is displayed again. This time, 0 is displayed because all the records in the range are deleted.
```al
var
    MyFieldRef: FieldRef;
    CustomerRecRef: RecordRef;
    Text000: Label 'The number of records in the range is %1.;
begin
    CustomerRecRef.Open(18);
    MyFieldRef := CustomerRecRef.Field(1);
    MyFieldRef.SetRange('10000' , '20000');
    Message(Text000 ,CustomerRecRef.Count);
    CustomerRecRef.DeleteALL;
    Message(Text000 ,CustomerRecRef.Count);
end;
```
## Related information
recordref-data-type
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/recordref/recordref-deleteall-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/recordref/recordref-deleteall-method/
