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.