Add Filter to report

rico1931rico1931 Member Posts: 295
edited 2014-05-20 in NAV Three Tier
Hi Everyone,

I think I'm missing something so simple but seem to be missing it and wondering if you all can help. I'm trying to modify report 10156 Purchase Order Status to be able to filter on the header for Purchaser Code. Users would like the report to show their PO's that are outstanding.

I've added the Purchase Header to the DataItem, and added the filter to the C/AL Globals and properties. Go the section to show up on the RequestForm.. but it does nothing :-(

I'm going to take a ball park guess and thinking I have to set some filters in the OnAfterGetRecord() portion but I'm stuck :(

Any direction would be grateful. Even a "hey go look at this report #??" would be really appreciated.. sorry but I just don't have much experience with reports and the online tutorials are just not helping. You are my only hope! :-)
-rico1931

Answers

  • Wisa123Wisa123 Member Posts: 308
    Right now you just added a DataItem, which is not connected to anything. You can filter as much as you want, there wont be happening anything.

    Usually to do what you want the report to do, the dataitem should look this way:
    ---SalesHeader
    SalesLine

    Then set the DataItemLinkReference property accordingly, and Filter the Sales Header, this way only Lines, that apply to the filtered SalesHeader are processed.
    Austrian NAV/BC Dev
  • rico1931rico1931 Member Posts: 295
    Just so everyone knows for report 10156, this isn't done very easily in the report. I got help from our partner and found the simplest way was to just modify the Purchase Line table to include a new FlowField for Purchaser code on the line and do a lookup. Then just add that new field to the ReqFilterFields on the Purchase Line properties.
    -rico1931
  • jglathejglathe Member Posts: 639
    Sounds like a hack to me... Usually it should be sufficient to add a dataitem "purchase header" above the purchase line, add purchaser code in the reqfilterfields, filter by document type and other desired (and available) fields. The dataitem for purchase line should be indented, and linked via primary key fields to the purchase header.
    Using a flow field as a filter works, but costs more processing time. And you have an additional field for a trivial reason.

    with best regards

    Jens
Sign In or Register to comment.