Hello again,
I also want to show the total gross weight and volume of the order in the sales order document. This information is available in the F9 statistics of teh sales order But I couldn't show it in my report
How can it be done?
Thanks
recSalesLine.RESET;
recSalesLine.SETCURRENTKEY("Document Type","Document No.","Line No.");
recSalesLine.SETRANGE("Document Type",recSalesHeader."Document Type");
recSalesLine.SETRANGE("Document No.",recSalesHeader."No.");
IF recSalesLine.FIND('-') THEN
REPEAT
decTotalGrossWeight += recSalesLine.Quantity * recSalesLine."Gross Weight";
decTotalVolume += recSalesLine.Quantity * recSalesLine."Unit Volume";
UNTIL recSalesLine.NEXT = 0;
Some remarks:
-SETCURRENTKEY is not necessary but always putting RESET-SETCURRENTKEY-SETRANGE/SETFILTER is a good programming practice
-the filters on the salesline come from the header whose totals you want
-recSalesLine.Quantity : this quantity or another quantity-field depending on which data you want
Regards,Alain Krikilion No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Comments
decTotalGrossWeight := 0;
decTotalVolume := 0;
recSalesLine.RESET;
recSalesLine.SETCURRENTKEY("Document Type","Document No.","Line No.");
recSalesLine.SETRANGE("Document Type",recSalesHeader."Document Type");
recSalesLine.SETRANGE("Document No.",recSalesHeader."No.");
IF recSalesLine.FIND('-') THEN
REPEAT
decTotalGrossWeight += recSalesLine.Quantity * recSalesLine."Gross Weight";
decTotalVolume += recSalesLine.Quantity * recSalesLine."Unit Volume";
UNTIL recSalesLine.NEXT = 0;
Some remarks:
-SETCURRENTKEY is not necessary but always putting RESET-SETCURRENTKEY-SETRANGE/SETFILTER is a good programming practice
-the filters on the salesline come from the header whose totals you want
-recSalesLine.Quantity : this quantity or another quantity-field depending on which data you want
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!