Hi
ILE[2].SETRANGE("Posting Date",StartDate,EndDate);
ILE[2].SETFILTER(ILE[2]."Entry Type",'%1|%2',ILE[2]."Entry Type"::Consumption,ILE[2]."Consumption Type"::Rev);
ILE[2].SETFILTER(Quantity,'>%1',0);
IF ILE[2].FINDFIRST THEN REPEAT
Qty[2] += ILE[2].Quantity;
MESSAGE('%1',ILE[2]."Entry Type");
UNTIL ILE[2].NEXT=0;
In message it is displaying +ve Adjustment , whereas i have filtered records on Entry Type "Consumption
Thanks
*This post is locked for comments
Hi
Take a look at this line:
ILE[2].SETFILTER(ILE[2]."Entry Type",'%1|%2',ILE[2]."Entry Type"::Consumption,ILE[2]."Consumption Type"::Rev);
You filter "Entry Type" field by option value from "Entry type" field (that's ok) and by option value from "Consumption Type" field (that's a mistake).
Hi
Can u pls tell me what is wrong in that Code.
Thanks
Hi
That's ok. But i want with Quantity > 0 & also Entry Type should be Consumption or Rev
Thanks
ILE[2].SETFILTER(Quantity,'>%1',0); here you are filtering quantity greater than zero.
TRY this.
ILE[2].SETRANGE("Posting Date",StartDate,EndDate);
ILE[2].SETFILTER(ILE[2]."Entry Type",'%1',ILE[2]."Entry Type"::Consumption);
ILE[2].SETFILTER(ILE[2]."Consumption Type",ILE[2]."Consumption Type"::Rev);
ILE[2].SETFILTER(Quantity,'>%1',0);
IF ILE[2].FINDFIRST THEN REPEAT
Qty[2] += ILE[2].Quantity;
MESSAGE('%1',ILE[2]."Entry Type");
UNTIL ILE[2].NEXT=0;
André Arnaud de Cal...
292,031
Super User 2025 Season 1
Martin Dráb
230,868
Most Valuable Professional
nmaenpaa
101,156