Business Central 2023 wave 1 (BC22): Code actions for refactoring ApplicationArea property

Dynamics 365 Business Central

Hi, Readers.
Dynamics 365 Business Central 2023 wave 1 (BC22) is generally available this month. More details: Dynamics 365 Business Central 2023 release wave 1 (BC22)

I will continue to test and share some new features that I hope will be helpful.

Code action for removing ApplicationArea on fields when same as page level:

Business value:
In 2022 release wave 2 we added the ability to specify application area on the page level, so that page fields could fall back to this value, resulting in cleaner code, and less work for developers. In this release we’re adding a code action to allow quick cleanup of existing code to move the application area from the fields to the page.

Feature details:
We are introducing two new code actions to help promote ApplicationArea from field to page level as well as clean up any redundancy. Both can be applied to an object, a document, a project, or a workspace.

https://learn.microsoft.com/en-us/dynamics365/release-plan/2023wave1/smb/dynamics365-business-central/code-action-removing-applicationarea-fields-when-same-as-page-level

The AL Language extension offers users the option to help fix issues in code. Code Actions is a Visual Studio Code feature providing the user with possible corrective actions right next to an error or warning. If actions are available, a light bulb appears next to the error or warning. When the user clicks the light bulb (or presses Ctrl+.), a list of available code actions is presented.

So, Code Actions provides possible corrective actions which will help the developer to code in a better way.
More details:
Using AL Code Actions
New AL Code Action for multiple layouts (Convert RDLCLayout/WordLayout/ExcelLayout to Rendering report session)

And in Business Central 2022 wave 2 (BC21), there was a new feature, ApplicationArea on fields defaults to page value.
For example, I created a new page and only set the ApplicationArea of the parent page.

All fields are now displayed properly.

With this wave, Microsoft added two new code actions to help promote ApplicationArea from field to page level as well as clean up any redundancy.
Let’s see more details.

A new code action is introduced that sets the default value for application area on a page or a report and clean up the duplicates this code action can be applied to an object, a document, a project or a workspace.

Before:

After:

A new code action is introduced that cleans up the redundant application areas if a default value is set on a page or a report. This code action can be applied to an object, a document, a project or a workspace.

Before:

After:

Very convenient, give it a try!!!😁

PS: Microsoft Learn (Docs) has also been updated, AL code actions.

Set the default value for ApplicationArea on a page or a report level and remove all duplicates on field level. This code action can be applied to an object, a document, a project, or a workspace.

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL