dvQTY := 0; recItemLedger.RESET; recItemLedger.SETCURRENTKEY("Item No.","Entry Type","Variant Code","Drop Shipment","Location Code","Posting Date"); recItemLedger.SETRANGE("Item No.",recSalesLine."No."); recItemLedger.SETRANGE("Variant Code",recSalesLine."Variant Code"); recItemLedger.SETRANGE("Location Code",recSalesLine."Location Code"); recItemLedger.SETFILTER("Remaining Quantity",'<>0'); IF recItemLedger.FIND('-') THEN BEGIN REPEAT DVQty := DVQty + recItemLedger."Remaining Quantity"; UNTIL recItemLedger.NEXT = 0; END;
recItem.RESET; recItem.SETRANGE("No.",recSalesLine."No."); recItem.SETFILTER("Location Filter",recSalesLine."Location Code"); IF recItem.FIND('-') THEN recItem.CALCFIELDS(Inventory); DVQty := recItem.Inventory; recItem.RESET;
Comments
Actually it is better to use CALCSUMS in original developer code
Yes, I missed it. Actually, I am yet to understand what exactly this Variant means? Never came across it and the company also only interested in the cost of item in a location
So, suppose, I also add "Variant filter". Which code you recommend to use?
Freelance Dynamics AX
Blog : http://axnmaia.wordpress.com/
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Where is it going to be used?