FILTERPAGEBUILDER

clementinaclementina Member Posts: 5
edited 2017-05-23 in NAV Tips & Tricks
Hi ,

Has anyone used the filterpagebuilder but with multiple tables not just one like this https://community.dynamics.com/nav/b/technicaltipsandtricksfordynamicsnav/archive/2015/10/07/filter-pages-for-filtering-tables-using-filterpagebuilder ?

Thanks

Answers

  • NavNabNavNab Member Posts: 181
    Hi @clementina,

    Do you know that "Yes" or "No" fully answers your question? :smiley:

    But I doubt this is what you're looking for.

    Give more details about what you want to achieve and all the community will be glad to help you

  • clementinaclementina Member Posts: 5
    edited 2017-05-23
    @nabil.bamoh@hotmail.com yes you're right sorry ! So basically I have a table which stores number plates and are linked to customer , the customer can have multiple number plates. I would like that once you open the customer list page you could also filter with the number plates although they are stored in another table. I was trying to use the filterpagebuilder ,but it only seems that you can filter on only one table.
  • NavNabNavNab Member Posts: 181
    it depends on how you design the link between your customers and your plates.

    If plates are linked as subpage then you cannot use SETTABLEVIEW on SubPage as it is not supported.

    If plates are linked via an action, then you can apply your filter before you run the plates page.

    Anyway, here is an example of FilterPageBuilder with two tables and where I filter on two tables and I use different functions than the link you provided:

    MyFilterPageBuilder.ADDTABLE('Cust', Customer.RECORDID.TABLENO);
    MyFilterPageBuilder.ADDFIELDNO('Cust', Customer.FIELDNO("No."));

    MyFilterPageBuilder.ADDTABLE('Bank', CustomerBankAccount.RECORDID.TABLENO);
    MyFilterPageBuilder.ADDFIELDNO('Bank', CustomerBankAccount.FIELDNO(Code));

    MyFilterPageBuilder.RUNMODAL;

    MESSAGE('Cust Filter = %1\Bank Filter = %2', MyFilterPageBuilder.GETVIEW('Cust'), MyFilterPageBuilder.GETVIEW('Bank'));



    PS1: Variables are: Customer (Table 18) and CustomerBankAccount (Table 287).
    PS2: I used Customer Bank Account for this example because I think it should be similar to what you want to do with your "Plates".
    PS3: I wrote the code in NAV 2016. You may need to adapt it if you use another version.

    On another note, if I understand your requirement, you may have a look at "My Customer". It should be close to what you want to achieve :wink:

    I hope this will inspire you find the right solution
  • vaprogvaprog Member Posts: 1,141
    In your case you might want to convert the view for the Customer table into a filter string for Customer."No.". You do this using the functions in Codeunit 46 SelectionFilterManagement.

    Then you apply the view for the number plate table from the filter page to your page, as well as the filter for the customer no. to the corresponding field of the number plate table. To do the latter, either set the filter and view on a record and run the number plate page with that record, or create a function on the page that allows you to pass in that filter.
  • krikikriki Member, Moderator Posts: 9,112
    [Topic moved from 'General Chat' forum to 'NAV Tips & Tricks' forum]

    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.