Set different control properties

Completed

Different controls have different properties, such as NotBlank, ShowMandatory, UpdatePropagation, and ApplicationArea.

NotBlank and ShowMandatory

The NotBlank property can be applied to fields and controls. You can find this property on the fields of a table or on the control of a page.

NotBlank indicates that the field is mandatory. It displays an error when the user attempts to save with a blank mandatory field. When NotBlank is set on a field, all related controls treat the field as required.

The ShowMandatory property provides a visual indication that a field is required. It doesn't give an error if you leave the field blank. Required fields are marked with a red asterisk.

Screenshot showing the ShowMandatory property alert.

UpdatePropagation

The UpdatePropagation property determines what happens when a subpage is updated. For example, it determines whether the main page is updated.

This property has two options:

  • Subpage - Updates only the subpage.

  • Both - Updates both the subpage and the main page.

ApplicationArea

Application areas help define the user experience by showing or hiding features based on user needs. Application areas are assigned to page controls to determine whether those controls are displayed. Page controls or actions without application areas aren't displayed in cloud experiences.

The ApplicationArea property is found on the page but also on field, part, and action controls. It's a text string that contains a comma-separated list of application area tags. The ApplicationArea property determines which controls appear based on the user's license, such as Essentials or Premium.

An application area tag must have the format name, where name is the application area. It can be a combination of letters and numbers without spaces. To specify the Basic and Suite application areas, the property can be set to Basic,Suite.

You can set the property to All when the control applies to all application areas. Setting the property to All means that the control will always appear in the user interface.

If one or more application areas are enabled in a session, any controls that aren't tagged with an application area won't appear in the user interface.

When targeting runtime version 10.0 (that is, 2022 release wave 2) or higher:

  • Page controls without the ApplicationArea property explicitly set inherit the ApplicationArea defined on the parent page (or report if request page).

  • Rules AS0062 and PTE0008 have been updated so you don't need to specify an explicit ApplicationArea on the page control, as long as it is set on the parent object level, thereby providing a default.

  • ApplicationArea can be used without UsageCategory on pages to provide a default fallback for controls, without forcing search visibility.

  • No impact on search; UsageCategory and ApplicationArea are still both required.

  • No impact on page (or report) extensions; values must still be set explicitly there.

UsageCategory

The UsageCategory property is a required setting used together with the ApplicationArea property. This enables a page or a report to be available in Search for the navigation support.

The Tell me feature lets users find pages and reports by entering search terms. Pages and reports in an extension are typically made searchable through Tell me. In AL, you make a page or report searchable from Tell me by setting the UsageCategory property in code. The UsageCategory property makes a page or report searchable and determines its search category.

When you create a Page or a Report, you add the UsageCategory property. If the UsageCategory property is set to None, or if you don't specify UsageCategory, the page or report won't show up when you search in Dynamics 365 Business Central.

You can specify other words or phrases that can help users find a page or report by using the AdditionalSearchTerms and AdditionalSearchTermsML properties. If the page or report is searchable by Tell me (that is, the UsageCategory property is set a value other than None), the search terms specified by these properties are used in addition to the caption of the page or report. These properties are useful when the caption doesn't always reflect what users will look for. A good example of this in Business Central is pages and reports associated with items. Users unfamiliar with Business Central might look for product or merchandise instead of items.

The following example creates a SimpleItemList page and sets a UsageCategory property to the page, so that the SimpleItemList page is discoverable through search using the Tell me feature. Also, the example sets the AdditionalSearchTerms property to add two search terms for the page.

page 50210 SimpleItemList 
{ 
    PageType = List; 
    SourceTable = Item; 
    UsageCategory = Lists;
    AccessByPermission = page SimpleItemList = X;
    ApplicationArea = All;
    AdditionalSearchTerms = 'product, merchandise';

    layout 
    { 
        area(content) 
        { 
            group(General) 
            { 
                field("No.";"No.") {} 
                field(Name;Name) {} 
                field(Description;Description) {} 
            } 
        } 
    } 
}