Getting blank value for filters using via request page

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?

  • Hi Ramesh,

     

    if you are using item ledger Entry table, Then Write the following Code i.e ur code 

    SETRANGE ("Posting Date", Postingdate);

    SETFILTER ("Location Code", Locationcode);

    in-------- Item Ledger Entry - OnPreDataItem()

    then you would get ur desired result ...

    Let me Know if u got Answer.

  • In reply to Raja Venkat:

    Ramesh,

    As your location code global is a code is a code and not text, use setrange not setfilter.

    Neil

Related