Permanent Filters On a Page in Nav 2016

omyvadiyaomyvadiya Member Posts: 124
Hi,
I am trying to filter a Lookup of a Page via writing code on OnLookup trigger of the Field, its working fine, i.e; when the page is opened, it opens with the filtered data, but here the problem is user can clear filters.
Is there any way to have permanent filters whenever the page is opened.
For Eg: I want to open Item Ledger Entry Page with filter of

1. ILERec.SETRANGE("Item No.","No.");
2. IF UserSetupRec.GET(USERID) THEN;
ILERec.SETRANGE("Location Code",UserSetupRec."Location Code");

A workaround i think is that, i have to somehow remove the clear filter option from the Page.

Thanks in Advance.


Best Answer

Answers

  • DuikmeesterDuikmeester Member Posts: 308
    edited 2019-03-19
    ILERec.FILTERGROUP(2);
    ILERec.SETRANGE("Item No.","No.");
    IF UserSetupRec.GET(USERID) THEN;
    ILERec.SETRANGE("Location Code",UserSetupRec."Location Code");
    ILERec.FILTERGROUP(0);
    
  • omyvadiyaomyvadiya Member Posts: 124
    edited 2019-03-19
    .
  • omyvadiyaomyvadiya Member Posts: 124
    Hi @Duikmeester ,
    Thanks its working :)

    But, i have a problem, that the lookup is showing the value as 0, if it has some value too. PFA.

    I know, it has to somehow work with Flowfield, any suggestions, how can i achieve it.

    Requirement- If there is any inventory at the location defined in Usersetup.Location code, then the count of the that inventory must show and on lookup the list of the same must show.

    Thanks in Advance


  • omyvadiyaomyvadiya Member Posts: 124
    Hi @Duikmeester ,
    The count of inventory is still 0, on lookup it is opening with correct location filter although.
    Any idea about flowfilters?
Sign In or Register to comment.