Good Morning all,
I'm working with Nav5.0 with sql server....
I've to calculate quantity on table Item Ledger Entry setting a filter on Location Code Field of this type: F*S
This is the code:
RecItemLedg.SETCURRENTKEY("Item No.", "Posting Date", "Location Code", "Reason Code");
RecItemLedg.SETRANGE("Item No.", RecGetto."Item No.");
RecItemLedg.SETRANGE("Posting Date", DateStart, DateEnd);
TempString := STRSUBSTNO('%1*%2', 'F', 'S');
RecItemLedg.SETFILTER("Location Code", TempString);
RecItemLedg.CALCSUMS(Quantity)
This Code Return an error, It can't calculate the sum of quantity because filter Cantains ? or *
C\SIDE Guide don't tell that CALCSUMS don't work with particular SETFILTER
Can you Help me please?
0
Comments
Try it like that, using an '|' instead of '*' in your filter.
Try this
RecItemLedg.SETFILTER("Location Code", 'F*S');
it should work.
have you created a key "Item No.", "Posting Date", "Location Code", "Reason Code" ?
have you add Quantity in sumindex field which is beside the key ?
if not then add it.
thanks,
Rajesh Patel
Sorry is not the filter that i have to do....
News Update:
IF I set the same filter on Item Card For Calculate inventory field pushing flow filter....Navision give the same error!
I try it also on native DB
Maybe is not possible....
have you add Quantity in sumindex field which is beside the key ?
if not then add it.
thanks,
Rajesh Patel
Enabled Key SumIndexFields
Yes Item No.,Posting Date,Location Code,Reason Code Quantity
Rajesh Patel
If I did not decleared the key with sumindexfield i think the error was different....