Report Code

I am working on an inventory report and I want the report to disregard record where the Sales(Qty.) AND QuantityReturned are both zero. Sales(Qty) is a decimal field in the Item table. QuantityReturned is a global variable of type decimal. I am having trouble with the following code which I have placed in the OnAfterGetRecord Trigger of the Item Dataitem. IF Item.“Sales (Qty.)” = 0 AND QuantityReturned = 0 THEN CurrReport.SKIP; The error says "Type conversion is not possible because one of the operators conatains an invalid type Decimal AND Decimal. what is wrong with the code???

My guess is that you need some parentheses: IF (Item."Sales (Qty.)" = 0) AND (QuantityReturned = 0) THEN CurrReport.SKIP;… and don’t forget Item.CALCFIELDS(“Sales (Qty.)”)

Hi Stephen

quote:


IF Item.“Sales (Qty.)” = 0 AND QuantityReturned = 0 THEN CurrReport.SKIP; The error says "Type conversion is not possible because one of the operators conatains an invalid type Decimal AND Decimal.


Try This. The ‘If’ Statement is expecting a boolean return. IF (Item."Sales (Qty.)" = 0) AND (QuantityReturned = 0) THEN CurrReport.SKIP;