Say Hello to the new “Performance Profiler”

While going through what is new in BC 2022 wave 1, I found out a cool tool.

Here comes the new Performance Profiler. While many have implemented Telemetry and got some insight into their processes, this is a step forward from Microsoft to bring Telemetry tools on the BC user interface.

Now, the concept of a profiler is not a futuristic functionality, it has been implemented on many platforms, like Java Profiling or SQL Server Profiler or even MS Edge Profiler.

A profiler is a code monitoring tool, a tool that helps trace, recreate, and troubleshoot various issues in code.

Nevertheless, seeing a profiler in Business Central is so refreshing.

Let’s do a quick test to see how that works at high level.

I added an action on Customer List page that does nothing.

Well, it does something, it is waiting for 5 seconds before ending.

pageextension 50100 CustomerListExt extends "Customer List"
{
    actions
    {
        addlast(Reports)
        {
            action(TestProfiler)
            {
                ApplicationArea = All;

                trigger OnAction()
                var
                    _DateTime: DateTime;
                begin
                    _DateTime := CurrentDateTime();
                    _DateTime := CreateDateTime(DT2Date(_DateTime), DT2Time(_DateTime) + 5000);
                    while (CurrentDateTime() < _DateTime) do
                        Sleep(1000);
                end;
            }
        }
    }
    trigger OnOpenPage();
    begin
        Message('App published: Hello world');
    end;

}

I published it and let’s see if it is captured by Performance Profiler.

As the documentation recommended, I opened the Performance Profiler in its own page.

On the Business Central main browser window go to the Customer List and locate the new action:

On the Performance Profiler, click on the Start action.

Then launch the TestProfiler action.

When you get control to the main browser BC page, head over the Performance Profiler page and click Stop action. And here are the results:

We can see 2 regions:

  • one that shows what application extensions were detected between Start and Stop.
  • a second one, a technical part-page, with 2 sub-lists:
    • one showing the time spent by application object
    • second showing a call tree with timing for each branch

Very cool feature which I wish I had it in all previous BC versions.

How was this designed?

The main page Performance Profiler is based on Page 24 “Performance Profiler” in the Microsoft System Application.

Lots of other objects involved with the Performance Profiler to bring this new feature:

Take a look below, to compare the Microsoft System 19.5 versus Microsoft System 20.

With BC 2022 wave 1, the system application comes with a set of new objects to support Profiling.

All in all, Performance Profiler is a great addition to the Business Central platform.

This will help consultants locate faulty/slow code and record, download and send the recording to the authors of the code that performs poorly.

Knowing your Business Central data using the Page Inspection

With the promotion of Microsoft’s ERP Dynamics NAV as the only SMB Microsoft ERP in the cloud, the community gained a significant number of new users coming from other products.

Introduction of Cloud Migration feature or Data Migration in Business Central allowed delivery teams in the Partners space to bring in BC SaaS many end-users from Dynamics GP or SL, as well as from other non-Microsoft ERPs, like QuickBooks.

Those that consider themselves new to Business Central might find difficult to navigate and find what they need in their daily work with the new ERP.

This is when knowing about the Page Inspection page comes handy.

To enable the Page Inspection pane, you can use these keys:

  • CTRL + ALT + F1
  • navigating to “?” on the top right corner -> click on Help and Support -> look for “Inspect Pages and Data” link:

Once enabled, Page Inspection appears as a vertical frame in the browser window and allows users to see the components of each page.

Click on various page components and notice how the Page Inspection updates. Look for:

  • the fields included in that component
  • the extensions that touched the current page/component
  • existing filters for that component/page

Example:

Enabling Page Inspection on the Business Manager Role Center and selecting the frame in the middle uncovers valuable information:

The frame is actually a Card Page based on a BC table “Activities Cue” and the card page itself is Page 1310 “O365 Activities”.

Some users might ask:

  1. What are the records stored in this table?

For seeing the records there are a few options:

In the page inspection pane, click on “View Table” link:

This will open up the default page for table 1313

  • Another way of displaying all records in a table is to go to Table Information page, Search for table 1313, and click on the flow field “No. Of Records”
  • Ultimately, the users can run the table from the URL. Copy the link up to and inluding the environment name (in my example below, include everything up to “Production” then add “/?table=1313”

2. What data is available for each record?

There are three Tabs at the top:

  • Table Fields
    • use the magnifying loop(under Page Filters) to filter the fields by name or value
    • not all fields available in the table are displayed on the page. You can try to Personalize your page or ask your Partner to help you. To enable a field for all users within one profile you might want to ask your admin to customize the page.
  • Extensions
    • Custom code affects tables and pages. You can easily see what extensions have touched the current table/page

Note: you can easily detect which fields belong to which extension as new extensions need to include a suffix or prefix for each field/action/page/table.

  • Page Filter: filters are often used to display the data in Business Central. This tab gives good clues into how the data has been filtered:

If you do not see the details you’re expecting to see in the Page Inspection page, you probably do not have the right permission. Talk to your admin and ask them to give you D365 Troubleshoot permission set or user group.

For some Microsoft official documentation on the Page Inspection read this.