Business Central UI Tip: Show Dash (–) Instead of Zero in List Pages

When customizing List or ListPart pages in Dynamics 365 Business Central, FlowFields can sometimes behave differently than expected—especially when you want to display a dash ("–") instead of a zero. This is a subtle UI detail that enhances readability for end-users, and mimics the behavior seen in standard pages like Job Task Lines Subform.

In this blog, we’ll explore how to reproduce this formatting behavior for custom FlowFields.

In this code, we extended the Item Ledger Entries page to add a calculated field (RKTest) that displays the "Cost Amount (Actual)". We used BlankZero = true and AutoFormatType = 1 to show a dash () when the value is zero. The value is set in the OnAfterGetRecord() trigger, and we blocked drilldown using the OnDrillDown() trigger with a message. This ensures clean formatting and avoids confusion for users when no value is present.

pageextension 50100 "ItemLedgerEntryExt" extends "Item Ledger Entries"
{
    layout
    {
        addbefore("Lot No.")
        {
            field(RKTest; RKTest)
            {
                ApplicationArea = All;
                Editable = false;
                AutoFormatType = 1;
                BlankZero = true;
                Style = Standard;

                trigger OnDrillDown()
                begin
                    Message('No lookup on formula');
                end;
            }
        }
    }

    var
        RKTest: Decimal;

    trigger OnAfterGetRecord()
    begin
        RKTest := Rec."Cost Amount (Actual)" - 0;
    end;
}

O/p:


Thanks For Reading...!!


Regards,

Khushbu Rajvi

Comments

Popular posts from this blog

Dynamics 365 Business Central: Enabling Custom and Default Tables in the "Search Company Data" Feature

Dynamic 365 Business central: Header on First, Footer on Last page in RDLC Reports

Dynamic 365 Business central: How to Automatically Insert Line Breaks After a Specific Character Limit