Business Central 2024 wave 2 (BC25): Support for the Scope property on Enums and AL Interfaces

Dynamics 365 Business Central

Hi, Readers.
The public preview for Dynamics 365 Business Central 2024 release wave 2 (BC25) is available. Learn more: Link.

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

In this post, I would like to talk about Support for the Scope property on Enums and Interfaces in Business Central 2024 release wave 2 (BC25). This is not yet documented in the Business Central 2024 release wave 2 (BC25) release plan. But it is mentioned in AL Language extension changelog Version 14.0

Added support for the Scope property on Enums and Interfaces

The Scope property is applicable to the following types:

Specifies the scope of the action to be either page-specific, or specific to a repeater control. The Scope property has two options; Page and Repeater.

More details: Dynamics 365 Business Central: How to add actions to the repeater control shortcut menu (Defining Action Scope)

When a table is marked with Scope = OnPrem it is not available to a cloud extension. System tables that have the Scope property set to Internal (OnPrem) cannot be accessed from extensions that have the target property set to Cloud or Extension through direct reference or through RecordRef.

Note:
The following options ExtensionInternal, and Personalization are being deprecated with runtime 4.0. Extension is replaced by Cloud and Internal is replaced by OnPrem.

For example,
table 2000000206 “Published Application”:

“target”: “Cloud” (app.json)

The application object or method ‘Published Application’ has scope ‘OnPrem’ and cannot be used for ‘Cloud’ development. AL AL0296

With this wave (BC25), Microsoft added support for the Scope property on Enums and Interfaces. This is the same as the processing of Scope Property (Table).

Enums:

Cloud (Default value): The enum is accessible from extensions compiled with the ‘Cloud’ or ‘OnPrem’ compilation targets.

OnPrem: The enum is accessible from extensions compiled with the ‘OnPrem’ compilation target.

This property cannot be set in an Enumextension object.

Interfaces:

Cloud (Default value): The interface is accessible from extensions compiled with the ‘Cloud’ or ‘OnPrem’ compilation targets.

OnPrem: The interface is accessible from extensions compiled with the ‘OnPrem’ compilation target.

This is also available when extending the AL interface. More details about Business Central 2024 wave 2 (BC25): Extend AL interfaces

Great. Give it a try!!!😁

PS:
1. When setting “target”: “Cloud”, you cannot set the Scope property on Enums and Interfaces to OnPre

2. Compilation scope overview

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL