Apply select code actions across objects and projects

Important

This content is archived and is not being updated. For the latest documentation, go to What's new and planned for Dynamics 365 Business Central. For the latest release plans, go to Dynamics 365 and Microsoft Power Platform release plans.

Enabled for Public preview General availability
Admins, makers, marketers, or analysts, automatically Sep 1, 2022 Oct 1, 2022

Business value

Code actions in Visual Studio Code help automate refactoring code, such as AL. Sometimes the suggested code refactoring makes sense for a larger scope than just a specific case within AL. Until now there has been no way to trigger code action refactoring on a larger scope than for the specific case, leading to tedious and error-prone execution of the code actions in all of the applicable cases. With this release wave we introduce support for running the code action either just on the specific case, or on all cases within the file, project, or solution, speeding up this kind of refactoring.

Feature details

Some code actions make sense to run in a larger context than for just the instance. If the code action supports it, there will be the option to run it either on the specific manifestation it's triggered from, within the document it's triggered from, within the project it's triggered from, or within the complete workspace. This allows developers to refactor code faster and more efficiently across a larger source scope without having to go to each specific manifestation to trigger the code action there.

In 2022 release wave 2, the following code actions support running in larger scopes:

  • Convert promoted actions
  • AA0008 - Add parenthesis
  • AA0241 - To lowercase

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.

See also

AL Code Actions (docs)