{"title":"RecordRef.DeleteAll([Boolean]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/recordref/recordref-deleteall-method/","by":"JOP-AL","license":"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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/recordref/recordref-deleteall-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Deletes all records in a table that fall within a specified range.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"RecordRef.DeleteAll([Boolean]) Method","slug":"recordrefdeleteallboolean-method","at":0,"chars":1783},{"level":2,"title":"Syntax","slug":"syntax","at":167,"chars":64},{"level":2,"title":"Parameters","slug":"parameters","at":231,"chars":379},{"level":2,"title":"Remarks","slug":"remarks","at":610,"chars":90},{"level":2,"title":"Example","slug":"example","at":700,"chars":946},{"level":2,"title":"Related information","slug":"related-information","at":1646,"chars":137}],"text":"# RecordRef.DeleteAll([Boolean]) Method\n> Version: _Available or changed with runtime version 1.0._\nDeletes all records in a table that fall within a specified range.\n## Syntax\n```al\n RecordRef.DeleteAll([RunTrigger: Boolean])\n```\n## Parameters\nRecordRef\nType: recordref-data-type\nAn instance of the recordref-data-type data type.\n*[Optional] RunTrigger*\nType: ../boolean/boolean-data-type\nSpecifies 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.\n## Remarks\nThis method works the same way as the DeleteAll Method \\(Record\\)<../library>.\n## Example\nThe 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.\n```al\nvar\n    MyFieldRef: FieldRef;\n    CustomerRecRef: RecordRef;\n    Text000: Label 'The number of records in the range is %1.;\nbegin\n    CustomerRecRef.Open(18);\n    MyFieldRef := CustomerRecRef.Field(1);\n    MyFieldRef.SetRange('10000' , '20000');\n    Message(Text000 ,CustomerRecRef.Count);\n    CustomerRecRef.DeleteALL;\n    Message(Text000 ,CustomerRecRef.Count);\nend;\n```\n## Related information\nrecordref-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}