Commit requires a comment explaining why (DC0001)

Using Commit() in AL code breaks the implicit transaction model and should be rare. When a commit is genuinely required, it must be accompanied by a comment explaining why the commit is necessary.

Without documentation, future maintainers cannot determine whether the commit is intentional or accidental, making it difficult to refactor or audit the code safely.

Example

The following code uses Commit without explanation:

codeunit 50100 MyCodeunit
{
    procedure MyProcedure()
    begin
        Commit(); // Commit requires a comment explaining why [DC0001]
    end;
}

To fix this, add a comment explaining why the commit is necessary:

codeunit 50100 MyCodeunit
{
    procedure MyProcedure()
    begin
        // Commit required: external web service call follows and must not be rolled back
        Commit();
    end;
}