Hi, Readers.
The public preview for Dynamics 365 Business Central 2025 release wave 2 (BC27) 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 New values (AsReadOnly & AsReadWrite) for the AllowInCustomizations property.
This new feature is not yet documented in the Business Central 2025 release wave 2 (BC27) release plan but is mentioned in AL Language extension changelog Version 16.0.
To give AL developers more control over how table fields are used in customizations, new values have been added to the AllowInCustomizations property:
Never– still excludes a table’s fields from the in-client designer.AsReadOnly– allows use in page customizations, but only as read-only.AsReadWrite– allows fields to be made editable in page customizations.The default value
ToBeClassifiedand the obsolete valueAlwaysboth behave likeAsReadOnly.For efficiency, AllowInCustomizations can now also be set at the table and table extension level. On table extensions, this only applies to fields declared in the table extension and does not affect the base table fields.
To support field classification, new analyzer rules are introduced: AS0138, AS0139, and PTE0026. These rules are currently optional and do not block AppSource submissions or PTE uploads. Learn more in the dedicated sections for analyzer rules.
Changelog | Visual Studio Marketplace
In Business Central 2023 wave 2 (BC23), 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.
With this wave (BC27), new values have been added to the AllowInCustomizations property:
Never– still excludes a table’s fields from the in-client designer: The field cannot be used as source expression for new page fields in page customizations.
AsReadOnly– allows use in page customizations, but only as read-only: The field can be used as source expression for new page fields in page customizations, but it cannot be made editable.
When setting Editable to true in pagecustomization, the following error will be prompted.
You cannot set the ‘Editable’ property to ‘true’ for Control ‘Custom Field’ in the page customization ‘MyCustomization’. Reason: ‘The source table field has AllowInCustomizations set to ‘AsReadOnly’.’. AL AL0808
AsReadWrite– allows fields to be made editable in page customizations: The field can be used as source expression for new page fields in page customizations, and it can be made editable.
The default value ToBeClassified and the obsolete value Always both behave like AsReadOnly.
- ToBeClassified – The field has not yet been given a classification. By default, the field can be used as source expressions for new page fields in page customizations, but it cannot be made editable.
‘Always’ is being deprecated in the versions: ‘16.0’ or greater. The property value ‘Always’ is deprecated in favor of ‘AsReadOnly’ or ‘AsReadWrite’ which are more explicit about their intent. This warning will become an error in a future release. AL AL0667
For efficiency, AllowInCustomizations can now also be set at the table and table extension level.
On table extensions, this only applies to fields declared in the table extension and does not affect the base table fields.
The property ‘AllowInCustomizations’ cannot be customized. AL AL0246
Great, give it a try!!!😁
END
Hope this will help.
Thanks for reading.
ZHU
コメント