Read Filters in OnInitReport

tompynationtompynation Member Posts: 398
Is it possible to read the Filters from a report in the OnInitReport?

I need to do this cause i will fill up a global variable on the Request Form. This global variable will depend on the Filter in the Report.

Comments

  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    From the online help...
    OnInitReport
    The C/AL code in this trigger is executed when the report is loaded. This could be, for example, code that initializes global variables.

    Applies to
    Reports

    Comments
    The system executes this trigger before the request form is run and before any table views or filters are set.
    Now think about your question... :wink:
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • kinekine Member Posts: 12,562
    As the help describe: it cannot be done, because you do not have access to the filters in this moment. Filters from request form are accessible first time in OnPreReport, it means after you click OK, Print or Preview...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DaveTDaveT Member Posts: 1,039
    Hi,

    Have you considered splitting into a normal form and report. As described it's not possible in a report on it's own but you could call a normal form in the onprereport trigger (modal of course) and pass the filters back - then (re)set the filters in the onpredataitem trigger.

    Can you give more details to see if it's a runner.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
Sign In or Register to comment.