web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Purchased quantity last fiscal year

(0) ShareShare
ReportReport
Posted on by 100

Dear community,

I am writing an extension to add the purchased quantity of an item to the item's table for last fiscal year, the fiscal year two years ago etc.
I am currently using a FlowField for this along with a CalcFormula.

But how do I filter the FlowField-result for last fiscal year, the fiscal year two years ago etc?
I cannot find any "good" filter-instructions for CalcFormula when googling.
I tried adding ""Document Date" = filter(1FY[1..LP)" to the CalcFormula but it doesn't work.

So far I have the following code:

tableextension 50200 "Item Table Ext. TFF" extends Item
{
    fields
    {
        field(50200; "Purchased Quantity: -1 Year"; Decimal)
        {
            Caption = 'Purchased Quantity: -1 Year';
            FieldClass = FlowField;
            CalcFormula = sum ("Item Ledger Entry".Quantity where("Item No." = field("No."), "Entry Type" = CONST(Purchase), "Document Date" = filter(1FY[1..LP])));
            TableRelation = "Purch. Inv. Line"."No." where("No." = field("No."));
            ValidateTableRelation = false;
            Editable = false;
        }
    }
}

Which is the best way to filter the FlowField results?

Thank you for your help.

I have the same question (0)
  • Verified answer
    Andy Sather Profile Picture
    Microsoft Employee on at

    Hello  - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

  • Verified answer
    YUN ZHU Profile Picture
    98,014 Super User 2026 Season 1 on at

    I think you can refer to the following. But like flowfield, this may reduce performance, so not really recommended.

    pastedimage1600316958890v1.png

    pastedimage1600316986637v2.png

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,091 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,032 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 946 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans