Please add Setcurrentkey for index “Document Type", Open, "Posting Date", "Closed at Date" to CalcAverageCollectionDays function in "Activities Mgt."(CodeUnit 1311) as calculation accessing Customer ledger entry is very slow.
Comments
I have included the missing setcurrentkey command in the comment below
Category: Development
local procedure GetPaidSalesInvoices(var CustLedgerEntry: Record "Cust. Ledger Entry") begin CustLedgerEntry.Setcurrentkey(“Document Type", Open, "Posting Date", "Closed at Date"); CustLedgerEntry.SetRange("Document Type", CustLedgerEntry."Document Type"::Invoice); CustLedgerEntry.SetRange(Open, false); CustLedgerEntry.SetRange("Posting Date", CalcDate('', GetDefaultWorkDate()), GetDefaultWorkDate()); CustLedgerEntry.SetRange("Closed at Date", CalcDate('', GetDefaultWorkDate()), GetDefaultWorkDate()); end;
Category: Development
The following AL code is slow as a resultAppObjectType: CodeUnit AppObjectId: 1311 AL CallStack: "Activities Mgt."(CodeUnit 1311).CalcAverageCollectionDays line 8 - Base Application by Microsoft"O365 Activities Dictionary"(CodeUnit 1310).OnRun(Trigger) line 9 - Base Application by Microsoft
Category: Development
Business Central Team (administrator)
Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future. Best regards, Business Central Team