I want to filter posting date and location code from item ledger table. I have created global variable for date as Postingdate -> Date, locationcode -> Code
In C/al code I write the
SETRANGE ("Posting Date", Postingdate);
SETFILTER ("Location Code", Locationcode); in OnPreDataItem () trigger
When i run the code and i filled the values for Posting Date and Location Code. But the filter fetches only empty value.
Please help me? What are the steps to be done to filter based on location and date?
if you are using item ledger Entry table, Then Write the following Code i.e ur code
SETFILTER ("Location Code", Locationcode);
in-------- Item Ledger Entry - OnPreDataItem()
then you would get ur desired result ...
Let me Know if u got Answer.
As your location code global is a code is a code and not text, use setrange not setfilter.