I am creating a report that displays various Item Card information for items where "Kit BOM No." is not blank. For each of these items, the report will go look in the Production BOM Line table and find all component item numbers. I'm fine so far. The problem comes when I need to go back into the item card to look for the on hand quantities for each of those components in the Kit BOM. The code I am trying does not error out, but rather it just displays the on hand quantity for the master item. Here is what I tried:
('kitdetail' is the variable name for the "Production BOM Line" table)
('BOM1' is the variable name for the first component item number. This is the variable for which I want to go find the on hand quantity in the item card.)
KitDetail.SETCURRENTKEY("Production BOM No.", "Version Code", "Line No.");
KitDetail.SETRANGE("Production BOM No.", Item."Kit BOM No.");
KitDetail.SETRANGE("Version Code", ' ');
KitDetail.SETRANGE("Line No.", 10000);
IF KitDetail.FINDFIRST THEN
BOM1 := KitDetail."No."
ELSE BEGIN
BOM1 := 'N/A';
END;
Item.RESET;
Item.SETCURRENTKEY("No.");
Item.SETRANGE("No.", BOM1);
BOMQty1 := Item.Inventory;
0
Comments
ERP Consultant (not just Navision) & Navision challenger
then add before it
ERP Consultant (not just Navision) & Navision challenger
RIS Plus, LLC
RIS Plus, LLC
Item.GET(BOM1);
Item.CALCFIELDS(Inventory);
BOMQty1 := Item.Inventory
the rest of the report works fine. I just cant get that BOM component quantity in there... any suggestions?
It could very well be in the wrong trigger, but there's no way to tell from here what the actual issue is, without the whole object and what it's supposed to do.
RIS Plus, LLC