A quick video on the new Continue functionality in AL. Now you can advance to the next iteration inside AL loops. Check out the video:

In this video, Erik walks through a new addition to the AL language in Business Central 2025 Wave 1 (BC26 / AL runtime 15.0): the continue statement. He demonstrates how it works across different loop types, discusses its relationship to the existing CurrReport.Skip functionality, and explores its limitations and practical implications.
The continue Statement Arrives in AL
With Business Central 2025 Wave 1 (also known as BC26 or AL version 15), Microsoft has added the continue statement to the AL language. If you’ve worked with other programming languages like C#, JavaScript, or Python, you’re likely already familiar with this concept. The continue statement skips the remainder of the current loop iteration and moves directly to the next one.
Project Setup
Erik’s demo uses a simple AL extension project targeting runtime 15.0 and application 26.0.0.0, which is the minimum version required to use the continue statement:
{
"id": "a07e6c3c-4772-4cbc-9f3a-0d358f0c272a",
"name": "Continue",
"publisher": "Default Publisher",
"version": "1.0.0.0",
"platform": "1.0.0.0",
"application": "26.0.0.0",
"idRanges": [
{
"from": 50100,
"to": 50149
}
],
"runtime": "15.0",
"features": [
"NoImplicitWith"
]
}
Using continue with a repeat...until Loop
Erik starts by building a classic repeat...until loop over the Customer table. The idea is straightforward: iterate through customer records, and if a customer’s balance exceeds 10,000, skip the rest of the loop body for that record and move on to the next one.
if Rec.FindSet() then begin
Rec.SetRange("No.", '10000', '50000');
repeat
// Tons of stuff happening before...
if Rec.Balance > 10000 then
continue;
Message('%1', Rec.Name);
// Tons of stuff happening after...
until Rec.Next() = 0;
end;
When Erik runs this against the Cronus demo data with the filter applied, only two customers appear in the messages — Trey Research and Alpine Ski House — because those are the only customers in the filtered range with a balance of 10,000 or less. Every other customer hits the continue statement, which skips the Message call and jumps straight to the until Rec.Next() = 0 evaluation.
A Fun Aside: Breaking Business Central with Messages
Erik initially forgot to apply a filter and ended up firing Message for a very large number of customer records. This effectively overwhelmed the client — a humorous reminder that if you queue up enough messages in a loop, Business Central will not handle it gracefully. As Erik put it: “How to break BC in less than 3 minutes — just put up enough messages.”
Using continue with Other Loop Types
The continue statement isn’t limited to repeat...until. It works with all loop constructs in AL.
With a while Loop
while Rec.Next() = 1 do begin
if Rec.Balance > 10000 then
continue;
// Processing code here...
end;
With a for Loop
for i := 1 to 100 do begin
if i > 40 then
continue;
// This code will only execute for i = 1 through 40
end;
In every case, continue connects to the closest enclosing loop and advances to the next iteration.
Scope Limitation: continue Must Be Inside the Loop
One important limitation Erik demonstrates is that continue must exist directly within the scope of a loop. You cannot extract it into a separate procedure and expect it to work. For example:
// This will NOT compile:
procedure Test()
begin
continue; // Error: no enclosing loop
end;
This makes sense because if you called Test() from outside a loop, there would be no loop context for continue to reference. The AL compiler enforces that continue must appear within the lexical scope of a repeat, while, for, or foreach block.
Debugger Behavior
Erik notices an interesting quirk when stepping through code in the debugger: when continue is hit, the debugger jumps directly to the loop’s next iteration without visibly stepping through the continue line itself. You also cannot place a breakpoint directly on a continue statement. This is a minor annoyance but worth being aware of when troubleshooting loop logic.
Relationship to CurrReport.Skip
Erik points out that AL has had a conceptually similar mechanism for a long time — but only within reports. The CurrReport.Skip method, typically used inside the OnAfterGetRecord trigger of a report dataitem, skips the current record and moves to the next one:
trigger OnAfterGetRecord()
begin
if SomeCondition then
CurrReport.Skip();
// Processing for records that meet criteria...
end;
You can think of continue as the general-purpose equivalent of CurrReport.Skip, now available in any loop context throughout your AL code.
Could You Always Achieve the Same Result?
Yes. As Erik honestly acknowledges, you could always achieve the same logical result using if statements:
// Without continue:
repeat
if Rec.Balance <= 10000 then begin
Message('%1', Rec.Name);
// Other processing...
end;
until Rec.Next() = 0;
// With continue:
repeat
if Rec.Balance > 10000 then
continue;
Message('%1', Rec.Name);
// Other processing...
until Rec.Next() = 0;
Both approaches produce identical results. The difference is stylistic and structural.
Pros and Cons
- Cleaner code (sometimes): Some developers argue that
continuereduces nesting and makes the “skip this record” intent more explicit, especially when there’s a lot of code inside the loop. - Harder to read (sometimes): Others argue that jumping out of part of a loop body can be harder to follow, particularly in complex loops with multiple
continuestatements. - Not revolutionary: Erik is candid that this isn’t a game-changing feature. It’s a quality-of-life improvement for AL developers who are accustomed to having
continueavailable in other languages.
Summary
The continue statement is a welcome, if modest, addition to AL in Business Central 2025 Wave 1. It works with repeat...until, while...do, and for...do loops, must be placed directly within the loop’s scope, and behaves exactly as developers familiar with other languages would expect. While you can always replicate its behavior with conditional if blocks, continue offers a more concise way to express “skip the rest of this iteration” — a pattern that comes up frequently when processing record sets. It’s a nice step forward in making AL feel more like a modern programming language.