Skip to main content

Notifications

Announcements

No record found.

Business Central forum

Cue Not Displaying Value Correctly

Posted on by 326

I'm trying to display a cue with the Count of Past Due Invoices next to a cue with the Sum of Past Due Invoices. They are both FlowFields, but one is based on a Query and the other is a CalcFormula. If I put the cues in separate CardPart pages they both display the correct value. If I put them together in the same CardPart page the cue based on the CalcFormula field (Count Past Due Invoices) displays 0. Am I doing something incorrectly?

page 50111 InvoicingCues
{
    PageType = CardPart;
    SourceTable = SalesCueEMP;
    RefreshOnActivate = true;

    layout
    {
        area(Content)
        {

            cuegroup(Invoicing)
            {
                Caption = '';
                field(CountPastDueInvoices; CountPastDueInvoices)
                {
                    ApplicationArea = All;
                    Caption = 'Past Due Invoices';
                }
            }
            cuegroup(Invoicing2)
            {
                Caption = '';
                field(PastDueInvoiceAmount; PastDueInvoiceAmount)
                {
                    ApplicationArea = All;
                    Caption = 'Past Due Invoice Amount';
                    AutoFormatExpression = '1,USD';
                    AutoFormatType = 10;
                    trigger OnDrillDown()
                    var
                        CustLedgEntryRec: Record "Cust. Ledger Entry";
                        CustLedgEntryPage: Page "Customer Ledger Entries";
                    begin
                        Clear(CustLedgEntryPage);
                        CustLedgEntryRec.RESET;
                        CustLedgEntryRec.SetFilter("Document Type", 'Invoice');
                        CustLedgEntryRec.SetFilter("Due Date", '<%1', WorkDate());
                        CustLedgEntryRec.SetFilter("Remaining Amount", '<>0');
                        CustLedgEntryRec.SetFilter(Open, 'Yes');
                        IF NOT CustLedgEntryRec.ISEMPTY THEN BEGIN
                            CustLedgEntryPage.SetTableView(CustLedgEntryRec);
                            CustLedgEntryPage.Run();
                        END
                        else
                            Message('No results found');
                    end;
                }
            }
        }
    }

    trigger OnOpenPage();
    begin
        RESET;
        if not get then begin
            INIT;
            INSERT;
        end;
        SetFilter(DateFilter2, '<%1', WorkDate());
    end;

    trigger OnAfterGetRecord();
    begin
        PastDueInvoiceAmount := CalcPastDueInvoiceAmount();
    end;
}

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans