Refresh field!!!!!
Hanen_T
Member Posts: 32
I need help :oops: , this is my code on the trigger AfterGetRecord of the Item Card:
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????
//<<-- 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
It's all about passion of Navision World
0
Comments
-
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.1291860
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 326 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions