The “Continue” Statement in Dynamics 365 Business Central 2025 Wave 1 (v26) – Finally Here! πŸŽ‰

For those of us who have been working with AL language for a long time, there’s always been one small but powerful feature we’ve been waiting forβ€”the “continue” statement! Well, with the release of Dynamics 365 Business Central 2025 Wave 1 (v26), it’s finally here! πŸ™Œ

What is the “Continue” Statement?

The “continue” statement is used inside loops to skip the rest of the current iteration and move directly to the next iteration of the loop. This means that when a continue is encountered, any remaining code in that iteration is ignored, and the loop immediately jumps to the next cycle.

Why is This Important?

Before BC26, if we wanted to skip specific iterations in a loop, we had to rely on complex if conditions or nested loops, making the code harder to read. Now, we can simply use continue, making our AL code much cleaner and more efficient!

How Does It Work? (Examples)

1. Skipping Even Numbers in a Loop

Let’s say we want to process numbers from 1 to 10, but we want to skip even numbers. Previously, we would have used an if condition to avoid executing the rest of the loop. Now, it’s much simpler:

procedure SkipEvenNumbers()
var
    i: Integer;
begin
    for i := 1 to 10 do begin
        if i mod 2 = 0 then
            continue; // Skips even numbers

        Message('Processing number: %1', i);
    end;
end;

Output:

Processing number: 1
Processing number: 3
Processing number: 5
Processing number: 7
Processing number: 9

(Even numbers are skipped!)

What’s Still Not Working?

While the “continue” statement is fully functional, IntelliSense does not yet recognize it when typing cont… in Visual Studio Code. This might be a temporary issue in the current preview version of the VS Code extension for Business Central. Hopefully, in the final release, IntelliSense will properly suggest it. However, the “continue” statement is already usable and works perfectly in compiled code! πŸŽ‰

Final Thoughts

As a Business Central developer, I have waited for this feature for a long time, and now that it’s here in BC26, I’m excited to start using it in my code! πŸŽ‰ This small but mighty addition to AL makes loops cleaner, more readable, and more efficient.

πŸ”Ή What do you think? Are you happy about the continue statement finally arriving in Business Central? Let’s discuss in the comments! πŸš€

Scroll to Top