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

Notifications

Announcements

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
    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
    96,181 Super User 2025 Season 2 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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,742

#2
YUN ZHU Profile Picture

YUN ZHU 844 Super User 2025 Season 2

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 719 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans