Hello,
I have a report which lists items detailing qty on sales orders and qty on purchase orders etc. all items have a Type which i have added as a data item and put in code to count all item lines by type using the following code:
Count := 0;
IF Item.FINDFIRST THEN
REPEAT
IF (Item.Type <> '') AND (Item.Type = Code) THEN
Count := Count +1
UNTIL Item.NEXT = 0;
This works fine and shows the correct total however i need to show totals for the other fields (Qty. on Sales Order etc) by type and have used the following code but is not working:
IF Item.FINDFIRST THEN
REPEAT
TotalQtySO := TotalQtySO + Item."Qty. on Sales Order";
UNTIL Item.NEXT = 0;
Any ideas or should this be done in a different way (Createtotals)?
0
Comments
as I see Item."Qty. on Sales Order" is a FlowField and I think you should use "CALCFIELDS" before working with it. Like:
IF Item.FINDFIRST THEN
REPEAT
CALCFIELDS(Item."Qty. on Sales Order");
TotalQtySO := TotalQtySO + Item."Qty. on Sales Order";
UNTIL Item.NEXT = 0;
Please rewrite wthe FINDFIRST to a FIND('-').
http://dynamicsuser.net/blogs/waldo/arc ... n-sql.aspx
:oops: yes of course you are right this (or better? FINDSET) definitely should be done...
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!