Dynamics 365 Business Central: introducing the new AllowInCustomization field property

Dynamics 365 Business Central 2023 Wave 2 release (version 23) will introduce the possibility to add any existing table field to a page via page customization (by users for their pages or by admins for a specific profile). This feature will be launched in the October release and listed as a “preview”.

More in details, the feature plans are the following:

From the Business Central web client, you will be able to:

  • Get access to any fields you want. The Add field pane is used to manage which fields are displayed on the page. Apart from the recommended fields that are already shown or hidden on the page, choose from additional fields that originate from the source table that powers that page, including fields from table extensions. Search, filter, or use tooltips to learn more about each field before choosing to add it to the page.
  • Drag and drop fields from the Add field pane to a precise location on the page canvas, or click to scroll a field into view or show the suggested place where it could be added on any type of page, such as card pages or lists. Adjust the content around them for an optimal experience.
  • Customize role centers by choosing which user profile to customize from the Profiles list page. Roll out minor customizations immediately in production, or start safely in a sandbox environment to get feedback from your users and roll out the change to production at the right time.
  • Start using fields immediately. Changes come into effect immediately once you finish customizing a user profile. Users assigned that profile will be able to view or edit the field value depending on the page context.

I was not a huge fan of this feature when it was announced. I think that giving users the possibility to add any existing field of a table in a page could create possibile risks of exposing fields that were never intended to be in the UI and maybe causing problems on some business processes.

To help on these possible problems, Microsoft will add a new property on table fields called AllowInCustomizations. This new property (Option) specifies whether a table field can be used as source expression for new page fields in page customizations. Possible values are the following:

  • Always: the field can be used as source expression for new page fields in page customizations. This is the default value.
  • Never: the field cannot be used as source expression for new page fields in page customizations.

Usage:

        field(1;"Your Field"; Code[20])
        {
            DataClassification = CustomerContent;
            AllowInCustomizations = Never;
        }

This new property can be used on table and tablextension objects.

You can change the value of the AllowInCustomizations property between releases of an extension (no breaking change on doing that). If you change that value from version X to version X+1 of an app moving from example from Always to Never, in the UI the field will then be ignored. In code you will see a compile errors (analyzers), but here things could change before the final release.

If in your extensions you have fields that you want to protect agains possibility to add them in UI pages via customizations in the future, I suggest to start planning a check and using this new property. Remember that this new property will require runtime 12 or higher (Business Central version 23 and above).

2 Comments

  1. I added a Page customisation in a Released Production Order Page with a field added in a Production Order table extension. The field appears for the Role (profile) created as expected. The problem is that it’s not editable in the page even if I set them as AllowInCustomizations=Always, Editable=true and Enabled=true in the tableextension.

    In your text, you said:

     Users assigned that profile will be able to view or edit the field value depending on the page context.

    What do you mean about “page context”? If I add the field directly in a pageextension it works, but not in pagecustomization

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.