Share via


Use the new continue keyword for AL loops

Enabled for Public preview General availability
Admins, makers, marketers, or analysts, automatically Apr 1, 2025 Apr 1, 2025

Business value

To make AL loops easier to write and read, you can now use the continue keyword in AL loops to go to the next iteration. This behavior is like other major programming languages.

Feature details

Like many other programming languages, AL now supports using continue in loops to trigger the next loop iteration. Before, only the break keyword was supported. The break keyword cancels the whole loop. The continue keyword skips the current loop iteration and goes to the next iteration.

To avoid a breaking change, the compiler doesn't support the continue keyword in loops if the context has a member called continue member, such as a method or field. The compiler warns about this restriction but still lets you declare object types with the name continue.

Geographic areas

Visit the Explore Feature Geography report for Microsoft Azure areas where this feature is planned or available.

Language availability

Visit the Explore Feature Language report for information on this feature's availability.

Tell us what you think

Help us improve Dynamics 365 Business Central by discussing ideas, providing suggestions, and giving feedback. Use the forum at https://aka.ms/bcideas.

Additional resources

Continue statement (docs)