CurrForm.ItemAvailMatrix.MatrixRec.SETRANGE("Use As In-Transit",ShowInTransit);
IF ShowColumnName THEN
MatrixHeader := CurrForm.ItemAvailMatrix.MatrixRec.Name
ELSE
MatrixHeader := CurrForm.ItemAvailMatrix.MatrixRec.Code;
//Stock:=0;
//QtySoldNotPst:=0;
ItemLedgerEntry.RESET;
ItemLedgerEntry.SETFILTER("Item No.","Item No.");
ItemLedgerEntry.SETFILTER("Variant Code","Variant Code");
ItemLedgerEntry.SETFILTER("Location Code",'%1',CurrForm.ItemAvailMatrix.MatrixRec.Code);
//ItemLedgerEntry.SETFILTER("Posting Date",GETFILTER("Date Filter"));
IF ItemLedgerEntry.FINDFIRST THEN BEGIN
ItemLedgerEntry.CALCSUMS("Remaining Quantity");
END;
I wrote the highlighted line to get the sum of "Remaining Qty" but when i run the form i got an error see plz the image belowe
0
Comments
Calcsums: Use this function to calculate the total of a column of SumIndexFields
If you look at the keys of the Item Ledger Entry table. You don't have "Remaining Quantity" as a sumindex
Either correct that or find a different way to accomplish your goal
http://www.BiloBeauty.com
http://www.autismspeaks.org
ItemLedgerEntry.RESET;
ItemLedgerEntry.SETCURRENTKEY("Item No.","Variant Code","Location Code");
ItemLedgerEntry.SETFILTER("Item No.","Item No.");
ItemLedgerEntry.SETFILTER("Variant Code","Variant Code");
ItemLedgerEntry.SETFILTER("Location Code",'%1',CurrForm.ItemAvailMatrix.MatrixRec.Code);
//ItemLedgerEntry.SETFILTER("Posting Date",GETFILTER("Date Filter"));
IF ItemLedgerEntry.FINDFIRST THEN BEGIN
ItemLedgerEntry.CALCSUMS("Remaining Quantity");
END;