Refresh field!!!!!

Hanen_THanen_T Member Posts: 32
I need help :oops: , this is my code on the trigger AfterGetRecord of the Item Card:
//<<-- 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

I need to store the StockF variable into a field in the item table.
How can I do tha, knowing that I need to keep this field uptodate????
Technico-Functional Consultant NAV
It's all about passion of Navision World

Comments

  • jglathejglathe Member Posts: 639
    Hi,

    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
Sign In or Register to comment.