Dynamics 365 Business Central: How to show more than 999+ in Cue on Role Centers (Show actual numbers instead of 999+)

Dynamics 365 Business Central

Hi, Readers.
Today I would like to talk about how to show more than 999+ in Cue (Show actual numbers instead of 999+). This is an interesting question I saw on the Dynamics 365 Community before. More details: Show actual numbers instead of 999+ in cues.

A Cue provides a visual representation of aggregated business data, like the number of open sales invoices. Cues are interactive, meaning that you can select the Cue to drill down to data or open another page, run code, and more. Cues display data that is contained in a table field. This data can be raw data or calculated data. More details: Creating Cues and Action Tiles on Role Centers

However, you may have encountered that when the number of some cues exceeds 999, it will display 999+ instead of the actual number. For example, 1038 -> 999+

table 1313 “Activities Cue”:

page 1310 “O365 Activities”:

Can we show more than 999+ in Cue on Role Centers???

In NAV, we can set the Image property on the page to “None” instead of “Stack”, then you will get the whole number. More details: How to show more than 999+ in RTC Cue

But unfortunately, this method does not work for Business Central. So in this post I will share a simple practice that can show actual numbers.

1. Add a new Decimal Data type field to the page (I added a variable, of course this can also use the actual field)

Since I don’t want to show the decimal point, I added the DecimalPlaces property, 0 : 0

PS: f you need additional formatting, use the AutoFormatExpression Property and AutoFormatType Property to control it, just like other amount fields.

2. Assign a value to this variable when opening the page. Since the original field is Flowfield, add the Record.CalcFields(Any [, Any,…]) Method first. More details: How to get value from a FlowField field

3. Refer to the standard Flowfield formula and DrillDownPageID to run similar logic in the field’s OnDrillDown trigger.

Done.

PS: If you don’t set the OnDrillDown trigger, it will appear gray and users will not be able to click it.

Very simple, so why is it like this? When the field is an Integer data type, the system will default the maximum value to 999, and display 999+ when it exceeds the value. However, for a Decimal data type, the system will display the actual amount, which is the principle of this solution. Give it a try!!!😁

Test code: Github (Please note that the source code is for reference only, you can improve it according to your own needs)

pageextension 50118 O365ActivitiesExt extends "O365 Activities"
{
    layout
    {
        addafter("Ongoing Sales Orders")
        {
            field(ZYSalesOrders2; ZYSalesOrders)
            {
                ApplicationArea = All;
                Caption = 'ZY Sales Orders';
                ToolTip = 'This field shows the number of sales orders.';
                DecimalPlaces = 0 : 0;
                Editable = false;

                trigger OnDrillDown()
                var
                    SalesHeader: Record "Sales Header";
                begin
                    SalesHeader.Reset();
                    SalesHeader.SetRange("Document Type", SalesHeader."Document Type"::Order);
                    Page.Run(Page::"Sales Order List", SalesHeader);
                end;
            }
        }
    }

    var
        ZYSalesOrders: Decimal;

    trigger OnOpenPage()
    begin
        Rec.CalcFields("Ongoing Sales Orders");
        ZYSalesOrders := Rec."Ongoing Sales Orders";
    end;
}

End

Hope this will help.

Thanks for your reading.

ZHU

コメント