Can't get the field value in Capacity Ledger Entry Table

eys-anson
Member Posts: 4
Dear all,
Nav version :5.0
we create a report for showing some fields of Capacity Ledger Entry Table,
the command as below:
CapLedgEntry.RESET;
CapLedgEntry.SETCURRENTKEY("Prod. Order No.");
CapLedgEntry.SETRANGE("Prod. Order No.","Production Order"."No.");
CapLedgEntry.SETFILTER("Quantity",'<>%1',0);
IF CapLedgEntry.FINDSET THEN REPEAT
k += 1;
dRoutingDirectCost[k] := CapLedgEntry."Direct Cost";
dRoutingOverheadCost[k] := CapLedgEntry."Overhead Cost";
message('%1...%2',CapLedgEntry."Direct Cost",CapLedgEntry."Overhead Cost");
dRoutingPostingDate[k] := CapLedgEntry."Posting Date";
dRoutingType[k] := FORMAT(CapLedgEntry.Type);
dRoutingLineCode[k] := CapLedgEntry."No.";
dRoutingOperation[k] := CapLedgEntry."Operation No.";
dRoutingLineDesc[k] := CapLedgEntry.Description;
dRoutingLineUnitCost[k] := ProdOrderRoutingLine."Unit Cost per";
dRoutingRunTime[k] += CapLedgEntry."Run Time";
dRoutingStdRunTime[k] += CapLedgEntry."Standard Run Time";
dRountingCapUOM[k] := CapLedgEntry."Cap. Unit of Measure Code";
dRountingQty[k] += CapLedgEntry.Quantity;
UNTIL (CapLedgEntry.NEXT = 0) OR (k = 9);
It can show the correct "quantity","Desc","No."...
But the "Direct Cost" and "Overhead Cost" can't get it ,just show "0"only!
Please help!
Thanks very much!
Nav version :5.0
we create a report for showing some fields of Capacity Ledger Entry Table,
the command as below:
CapLedgEntry.RESET;
CapLedgEntry.SETCURRENTKEY("Prod. Order No.");
CapLedgEntry.SETRANGE("Prod. Order No.","Production Order"."No.");
CapLedgEntry.SETFILTER("Quantity",'<>%1',0);
IF CapLedgEntry.FINDSET THEN REPEAT
k += 1;
dRoutingDirectCost[k] := CapLedgEntry."Direct Cost";
dRoutingOverheadCost[k] := CapLedgEntry."Overhead Cost";
message('%1...%2',CapLedgEntry."Direct Cost",CapLedgEntry."Overhead Cost");
dRoutingPostingDate[k] := CapLedgEntry."Posting Date";
dRoutingType[k] := FORMAT(CapLedgEntry.Type);
dRoutingLineCode[k] := CapLedgEntry."No.";
dRoutingOperation[k] := CapLedgEntry."Operation No.";
dRoutingLineDesc[k] := CapLedgEntry.Description;
dRoutingLineUnitCost[k] := ProdOrderRoutingLine."Unit Cost per";
dRoutingRunTime[k] += CapLedgEntry."Run Time";
dRoutingStdRunTime[k] += CapLedgEntry."Standard Run Time";
dRountingCapUOM[k] := CapLedgEntry."Cap. Unit of Measure Code";
dRountingQty[k] += CapLedgEntry.Quantity;
UNTIL (CapLedgEntry.NEXT = 0) OR (k = 9);
It can show the correct "quantity","Desc","No."...
But the "Direct Cost" and "Overhead Cost" can't get it ,just show "0"only!
Please help!
Thanks very much!
0
Comments
-
Those 2 fields are Flowfields.
you have to use CALCFIELDS function to calculate the value0 -
All those fields are flowfields, so you need to use CalcFields first.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K 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
- 320 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