Options

Setting filters via code on matrix page

GoMaDGoMaD Member Posts: 313
edited 2010-08-20 in NAV Three Tier
Hi,

I have a problem with the current matrix solution of NAV 2009 in the RTC.

What I want is to set a filter on the SourceTable of a Matrix page (PageType is ListPart) via code using SETFILTER or SETRANGE.
Because the filter is based on a variable that is passed to this page using a function.

You can place this code on the OnOpenPage trigger and when you debug the code and you will see that the code is executed without
problems or errors, if you place a Watch on the Rec of the page, you can see the filter being placed on the recordset, but when the page
is opened it seems that the filter is ignored and all records are shown that meet the filter in the SourceTableView property of the page.

Only when you set this filter on the OnAfterGetRecord trigger the filter will be applied.
BUT the first record in the table that meets the filter in the SourceTableView property of the page will also be shown!!!!!!

So if you set a filter on the OnAfterGetRecord trigger and no records meet this filter, you will see one record on the matrix
namely the first record in the table that meets the filter in the SourceTableView property of the page.

Can somebody help?
Now, let's see what we can see.
...
Everybody on-line.
...
Looking good!

Comments

  • Options
    GoMaDGoMaD Member Posts: 313
    It seams that you can't set filters by code on the OnOpenPage Trigger, but you can pass filters to the matrix page using the SubFormLink property on a page where the matrix page has been added as a part.

    If you want to set the filters using code, you can only set them on the OnAfterGetRecord trigger and then you get the problem specified in the original post.
    Does anybody know how you can solve this? Because you can't always use the SubFormLink property to set the filter.

    Regards,
    Now, let's see what we can see.
    ...
    Everybody on-line.
    ...
    Looking good!
  • Options
    GoMaDGoMaD Member Posts: 313
    Is there really no solution for this?
    Now, let's see what we can see.
    ...
    Everybody on-line.
    ...
    Looking good!
  • Options
    awarnawarn Member Posts: 261
    Did you find an answer for this issue? I am having a similar issue.
Sign In or Register to comment.