//<<-- BEGIN DateMax:=31122090D; IF FORMAT("Lead Time Calculation") = '' THEN BEGIN NewDateCalc:=CALCDATE("Lead Time Calculation",DateMax); END ELSE BEGIN NewDateCalc:=CALCDATE("Lead Time Calculation",WORKDATE); END; RecSales.SETCURRENTKEY("Document Type",Type,"No.","Variant Code","Drop Shipment","Build Kit","Location Code","Shipment Date"); RecSales.SETRANGE(RecSales."No.", Rec."No."); RecSales.SETFILTER("Shipment Date",'<=%1' , NewDateCalc); RecSales.CALCSUMS(RecSales."Outstanding Qty. (Base)"); AvailableStock:=RecSales."Outstanding Qty. (Base)"; CALCFIELDS(Inventory); StockF:=Inventory-(AvailableStock); IF StockF > 0 THEN BEGIN ItemStatus:=TRUE; END; //-->>END
Comments
IMO I wouldn't store StockF in the table. In a live system this will always change, I would calculate it on demand (maybe update it with a timer if necessary). The drawback is that you can't filter on StockF. This would require a field set as FlowFilter (same type as StockF), a second table (probably) and some pretty complex coding in the form/page.
with best regards
Jens
---
I am here: http://maps.google.com/maps?ll=52.549498,13.129186