Use the new continue keyword for AL loops
Important
Some of the functionality described in this release plan has not been released. Delivery timelines may change and projected functionality may not be released (see Microsoft policy). Learn more: What's new and planned
Enabled for | Public preview | General availability |
---|---|---|
Admins, makers, marketers, or analysts, automatically | Apr 2025 | Apr 2025 |
Business value
To make AL loops easier to write and read, you can now use the continue keyword in AL loops to continue to the next iteration, just like you are used to in other major programming languages.
Feature details
Like in many other programming languages, AL now supports using continue
in loops to trigger the next loop iteration. Before, only the break
keyword was supported, but that canceled the whole loop, whereas the continue
keyword skips the current loop iteration and proceeds with the next.
To address that members, such as methods or fields in AL, might already be named continue, the continue
keyword in loops will not be supported if the context has a member called continue. This is to avoid a breaking change. The compiler will warn about this, but still allow declaring object types with the name continue.
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.