Filtering the ReqFilterFields in Navision Reports

dianecandicedianecandice Member Posts: 11
Hi,

Let's say i have a report, and i only have one table in the Data Item.

and for that one table (i.e. Sales Header), my required filter field is "Sell to Customer No."

so when the user runs the report, he/she can place a filter for customer number either by typing a customer no. or by choosing through the customer list (that opens when the lookup button is clicked)

My question is, how do i set the Customer list window (when opened from the report) to show only customers that pass a certain condition, example, show only customers where Blocked = FALSE...

Comments

  • krikikriki Member, Moderator Posts: 9,110
    Possibility 1) Put the filter in the "SourceTableView"-property.
    Possibility 2) Put the filter in the "OnOpenForm"-trigger.

    With both every time the customer list is opened, the filter will be shown. With possibility 2, the user has the possibility to cancel the filter.

    Possibility 3) change the "OnLookup"-trigger of the field in the table to put the filters you want. With this everywhere a lookup of the field is done, this code will be triggered.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • dianecandicedianecandice Member Posts: 11
    hello, thanks for your reply.

    but does this apply to reports?

    how do i control the filter of lookup window that is being open within the required filter field of the report?
  • krikikriki Member, Moderator Posts: 9,110
    hello, thanks for your reply.

    but does this apply to reports?

    how do i control the filter of lookup window that is being open within the required filter field of the report?
    This is for reports. If you are in a report and need special filtering on a certain field of a dataitem, you can't change it in the coding.
    If I need to do it in a report, in general I put that field in the options-tab. There I can control the filtering in the lookup-form by writing the code.

    I have another possibility, but it requires a lot of programming.
    The idea is using a singleinstance codeunit. When entering the report, I give a certain value to the codeunit and when I open the lookup-form, I check if that value is in the codeunit and if it is I put some special filters. The problem is that when I leave the report, I have to destroy that value in the codeunit. I also have to destroy it when I open the report, but then close it again.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • CalicoCalico Member Posts: 31
    I read this topic with interest because I have the opposite problem. On certain reports the lookup on a filter field is itself already filtered. The filters are visible and can be removed but as soon as the report is re-run they re-appear.

    There are no filters on the lookup forms themselves, either in the code OnOpenForm or the SourceTableview (both empty), there is no code in the OnValidate or OnLookup triggers for those fields in the table which is the data item, and there is no code in the report OninitReport or OnPreReport triggers, and the DataItemTableView is empty. Can anyone suggest where else I should look for the source of these filters?
  • krikikriki Member, Moderator Posts: 9,110
    Did you try using the debugger? Maybe it shows where the code is put.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.