DELETE and DELETEALL in D365 BC:
(1) Introduction: When records are deleted in the tables via “AL” then the DELETE method is used. Note: recommended to delete any record in the table, specify filters on that record using “GET” or “SETRANGE” & “SETFILTER” for getting the records which you want to delete.
(2) Syntax: DELETE.
[Ok :=] Record.DELETE([RunTrigger]) |
(3) In the below example, the Sales order document is deleted, using the DELETE and DELETE(TRUE) method as shown.

(4) Introduction: If you delete a set of records in one go, then the DELETEALL method is used.
(5) Syntax: DELETEALL.
Record.DeleteAll([RunTrigger]) |

(6) There is another way to delete a set of records in one go by using the “DELETE” method with REPEAT UNTIL loop as shown.
