Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Unanswered

Cue Not Displaying Value Correctly

Posted on by 317

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;
}

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,513 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,862 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans