Creating page views

Since the fall 2019 release of Dynamics 365 Business Central, you can create customized views for your list pages. These customized views can be used in a dedicated section of the Dynamics 365 Business Central user interface to immediately apply filters to the list.

You can create a view definition in a page object by using the tview snippet. In the previously created Gift Campaign List page, we have defined the following view objects:

views
{
view(ActiveCampaigns)
{
Caption = 'Active Gift Campaigns';
Filters = where (Inactive = const (false));
}
view(InactiveCampaigns)
{
Caption = 'Inactive Gift Campaigns';
Filters = where (Inactive = const (true));
}
}

The first view (called ActiveCampaigns) shows all of the active gift campaigns (the Inactive field is set to false), while the second view (called InactiveCampaigns) shows all of the inactive gift campaigns (the Inactive field is set to true).

These views in the Dynamics 365 Business Central user interface look like this:

If you select the Active Gift Campaigns view, the list is filtered accordingly (Inactive is set to false):

If you select the Inactive Gift Campaigns view, the list is automatically filtered by Inactive being set to true:

We have also added a view to the Customer List page to show all of the customers who do not have an associated category.

The view definition in the Customer List pageextension object is defined as follows:

views
{
addlast
{
view(CustomersWithoutCategory)
{
Caption = 'Customers without Category assigned';
Filters = where ("Customer Category_PKT" = filter (''));
}
}
}

We have placed this newly created view as the last of the available views for the page:

As shown in the preceding screenshot, this view appears in the user interface of the application and, when selected, it automatically filters all of the customers without an associated category (so Customer Category = Blank). In this way, our customers can immediately filter records by selecting a pre-defined view (just a click) and without reinserting the required filters.

After this, let's move on and see how installing and upgrading codeunits works.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.183.150