Business Central 2023 wave 2 (BC23): Ability to define fields in page customizations (Add new fields in Page Customization Object)

Dynamics 365 Business Central

Hi, Readers.
The public preview for Dynamics 365 Business Central 2023 release wave 2 (BC23) 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 Ability to define fields in page customizations. This is not yet documented in the Business Central 2023 release wave 2 (BC23) release plan. But it is mentioned in AL Language extension changelog Version 12.

The page customization object in Dynamics 365 Business Central allows you to add changes to the layout and actions on page that are accessible for a profile. The page customization object has more restrictions than the page extension object; when you define a new page customization object, you cannot add variables, procedures, or triggers.

So it may be rarely used in your customization. But when you use the Customize pages feature on the Profiles (Roles) page, the page customization object is automatically generated in the background.
For example,

Export Profiles:

You can find the page customization object that modified the page just now. (Customization to different pages will be separated into different files)

But if you want to add a new field in page customization object, there will be the following prompt. So generally we can only choose to use page extension object.

You can only specify Move and Modify actions in the layout section of a page customization.

But this has been changed in BC23 (“runtime”: “12.0”). We can add groups and page fields using a table field as source expression in page customizations.
For example,

This is also reflected in the the Customize pages feature on the Profiles (Roles) page just mentioned.

In BC23.0, you can add fields from tables.

But in BC22.5, you can only add fields that have been added to the page but are not displayed.

Great improvements, give it a try!!!😁

Update: This feature is a prerequisite for the new features below.
Business Central 2023 wave 2 (BC23): Add existing table fields to optimize your pages (Adding Table Fields to Page without Page Extensions)

PS:
1. A new property AllowInCustomizations was introduced for table fields in order to specify whether they can be used as source expression for page fields created in page customizations. By default, table fields can be used as source expression for page fields created in page customizations.

(property) AllowInCustomizations: Option Always,Never
Specifies whether this table field can be used as source expression for new page fields in page customizations.

The field with ID ‘50100’ and name ‘MyCustField’ cannot be used as source expression in the page customization ‘MyCustomization’ targeting page ‘Customer List’.

2. See Using keywords to place actions and controls for how to place actions and controls on a page customization object.

KeywordsSyntaxApplies to
addfirstaddfirst(Anchor)Anchor: areas and groups
addlastaddlast(Anchor)Anchor: areas and groups
addafteraddafter(Anchor)Anchor: controls, actions, and groups
addbeforeaddbefore(Anchor)Anchor: controls, actions, and groups
movefirstmovefirst(Anchor; Target1, Target2)Anchor: area, group
Target: list of actions or list of controls
movelastmovelast(Anchor; Target1, Target2)Anchor: area, group
Target: list of actions or list of controls
moveaftermoveafter(Anchor; Target1, Target2)Anchor: controls, actions, and groups
Target: list of actions or list of controls
movebeforemovebefore(Anchor; Target1, Target2)Anchor: controls, actions, and groups
Target: list of actions or list of controls
modifymodify(Target)Target: controls, actions, and groups

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL