Record Parameter in function lost filters?

Hi Expert.

 

recently, When I am design a report, I found a strange problem, Maybe I have misunderstand of the point.

I.E.

NAV2016.

 

FUNCTION CALL:

G_WhseEntry.RESET;
G_WhseEntry.SETCURRENTKEY("Item No.","Bin Code","Location Code","Variant Code","Registering Date");
G_WhseEntry.SETRANGE("Bin Code","Bin Code");
G_WhseEntry.SETRANGE("Lot No.",G_WhseEntry_lot."Lot No.");
G_WhseEntry.SETRANGE("Location Code","Location Code");
G_WhseEntry.SETRANGE("Item No.",G_Item."No.");
G_WhseEntry.SETFILTER("Registering Date",'%1..%2',StartingDate,EndingDate);
G_WhseEntry.SETFILTER("Source Document",'%1|%2|%3',G_WhseEntry."Source Document"::"Phys. Invt. Jnl.",G_WhseEntry."Source Document"::"Item Jnl.",G_WhseEntry."Source Document"::"Reclass. Jnl.");
//G_WhseEntry.SETRANGE("Entry Type",G_WhseEntry."Entry Type"::"Negative Adjmt.");
G_WhseEntry.SETFILTER("Qty. (Base)",'<0');
QtckQTY := CalcWhseQty(G_WhseEntry,G_UOM,G_Item."No.");
Temp_Data.num7 := QtckQTY;

FUNCTION:

 

LOCAL CalcWhseQty( L_WhseEntry : Record "Warehouse Entry";L_ToUom : Code[50];L_ItemNo : Code[50]) : Decimal

//IF I ADD VAR FOR L_WHseEntry, we can get filter from the parameter, else it doesn't.
L_QTY := 0;
ERROR(L_WhseEntry.GETFILTERS); // HERE IS EMPTY

IF L_WhseEntry.FIND('-') THEN
REPEAT
L_QTY := L_QTY + L_WhseEntry.Quantity;//
UNTIL L_WhseEntry.NEXT = 0;

L_QTY := GetQTY(L_WhseEntry."Unit of Measure Code",L_ToUom,L_ItemNo,L_QTY);

EXIT(L_QTY);

 

if what I understand is correct?

 

Related