Item and Bom Component Report Help

boku25
Member Posts: 39
Tables:
Item
Bom Component
Global Variables:
BomCom Record Bom Component
QTY1 Decimal
QTY2 Decimal
I' am trying to create a report using two tables: Item and Bom Component. I am trying to show all Bom Items with a sub items within the Bom Component table.
So far I have everything but now I need to show the actual qty on hand for the sub item in the Bom Components, which is located in item table.
So my question is how I get the actual qty on hand to show for the sub item in the BOM on the report,
Currently I can see what makes up the BOM in correlation with the BOM Item, but I can not get the Qty on hand for the Sub item.
Item side
OnAfterGet Record
I tried this
BomCom.SETRANGE(BomCom."No.", Item."No.");
BomCom.GET(Item.” No.");
Item."No." := BomCom."No.";
QTY1 := Item.Inventory;
I also tried this
IF BomCom.FIND('-') THEN REPEAT
IF (Item."No." = BomCom."No.") And (BomCom."No." <>'') THEN BEGIN
Item.GET(BomCom."No.");
IF BomCom.FIND('-') THEN
QTY2 := Item.Inventory;
END;
UNTIL BomCom.NEXT=0;
Can someone help? ](*,)
Item
Bom Component
Global Variables:
BomCom Record Bom Component
QTY1 Decimal
QTY2 Decimal
I' am trying to create a report using two tables: Item and Bom Component. I am trying to show all Bom Items with a sub items within the Bom Component table.
So far I have everything but now I need to show the actual qty on hand for the sub item in the Bom Components, which is located in item table.
So my question is how I get the actual qty on hand to show for the sub item in the BOM on the report,
Currently I can see what makes up the BOM in correlation with the BOM Item, but I can not get the Qty on hand for the Sub item.
Item side
OnAfterGet Record
I tried this
BomCom.SETRANGE(BomCom."No.", Item."No.");
BomCom.GET(Item.” No.");
Item."No." := BomCom."No.";
QTY1 := Item.Inventory;
I also tried this
IF BomCom.FIND('-') THEN REPEAT
IF (Item."No." = BomCom."No.") And (BomCom."No." <>'') THEN BEGIN
Item.GET(BomCom."No.");
IF BomCom.FIND('-') THEN
QTY2 := Item.Inventory;
END;
UNTIL BomCom.NEXT=0;
Can someone help? ](*,)
0
Comments
-
That field is a flowfield, so you will have to to CALCFIELDS(Inventory) before you can use the value.0
-
And do not use to get this info the variable Item (I assume that this is name of first dataitem). Use some new variable (for example Items :-)0
-
That's a good point Kine. Yes, make sure that you are not doing the CALCFIELDS on the parent dataitem, because that is the assembly/BOM. You want the inventory of the component items, you will need to get those items with another variable.
I would create a new Item variable called ComponentItem, just to make sure you know which one you're working with in your code.0 -
Hi
I am trying to do something similar however I have a report which shows the list of Bill of Materials within a BOM Jnl. I would like to show the components for those items within Bill Of Materials (IF bill of material is true). I have BOM Component as a dataitem twice the first shows the list of bill of materials for the Jnl, I want the second dataitem item to list the components within the parent item of the Bill of material listed from the first dataitem however i'm not sure how to go about it?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