Hi All,
I want to add a flowfield to Item table to calculate quantity of earlier planned purchase order but below doesn't work;
Hi All,
I want to add a flowfield to Item table to calculate quantity of earlier planned purchase order but below doesn't work;
Is there any way we can compare two columns here calcFormula?For example if the Planned Receipt Date is equal to Promised Receipt data under Purchase Line Table?
Great, as long as it meets your needs you should be good, and there is no hard rule for creating flow field that you need to add the flow field only when you want to use multiple times.
Thanks this helped me to find a temporary solution as I created a flow field in Item table with Min date and applied it as below but I'm sure there is a better solution without creating field in item table:
begin
PurchLine.Reset;
PurchLine.SetRange("Document Type", PurchLine."Document Type"::Order);
PurchLine.SetRange("No.", ItemNo);
//PurchLine.SetFilter("Planned Receipt Date", '<%1', Today);
PurchLine.SetFilter("Planned Receipt Date", '=%1', Rec.EarliestPOArriveDate);
if PurchLine.FindSet() then
repeat
OutStdQty += PurchLine."Outstanding Quantity";
until PurchLine.Next() = 0;
exit(OutStdQty);
result
I don't think adding flowfields just for one report is a good idea except when you want to drill down
So basically the Planned Receipt Date is less than today's date, so you can apply that filter and count the quantity. Something like the below should work for your scenario.
local procedure GetOutstandingQty(ItemNo: Code[20]): Decimal var PurchLine: Record "Purchase Line"; OutStdQty: Decimal; begin PurchLine.Reset; PurchLine.SetRange("No.",ItemNo); PurchLine.SetFilter("Planned Receipt Date",'
I'll try to give data as below example:
PO Line Table
Item Qty Plan Receipt Date (YYYY-MM-DD)
A 10 2020-01-30
A 20 2020-01-20
B 5 2020-02-12
B 1 2020-03-23
A 1 2020-01-20
Now in Item List page we want to show
Item Earliest Plan Receipt Qty
A 21
B 5
So you want to know the quantity on purchase lines where the Planned Receipt Date is greater than today or earlier then today? if not, provide me an example
Ok thanks so GetRangeMin is not the correct approach ..Here's the actual scenario..
On the Item List Page I want to display the Quantity Outstanding on purchase order but only for the earliest planned receipt date on open purchase order lines. So instead of going through a list purchase order lines, item list will show quantity planned to receipt on next available PO (can have more than one on same date)..hope this make sense
GetRangeMin is used to get the filter, what is your actual requirement can you define it in detail
Thanks I worked on a function but the last bit of setting MIN filter has trouble ..not sure GETRANGEMIN works as below:
begin
PurchaseLine.Reset();
PurchaseLine.SETRANGE("No.", Rec."No.");
PurchaseLine.SetRange("Document Type", PurchaseLine."Document Type"::Order);
if PurchaseLine.FindSet() then
begin
PurchaseLine.GetRangeMin("Planned Receipt Date");
PurchaseLine.CalcSums(PurchaseLine."Outstanding Quantity");
TotQty := PurchaseLine."Outstanding Quantity";
end;
exit(TotQty);
Hello,
There is no option called Min when you apply the filter either you can reference the Field or Filter you cannot use Min. If you want that value only for display purposes then you can add a calculated field on the page which is a variable you will calculate the value based on your requirement in OnAfterGetCurrRecord of the page.
André Arnaud de Cal...
292,468
Super User 2025 Season 1
Martin Dráb
231,287
Most Valuable Professional
nmaenpaa
101,156