Wednesday, April 19, 2017

How to apply current page filters on Report in NAV 2016

Hi All,

Today I want to share a code which will setup the report to run on the current filters which are applicable on our current page.

For Example :-

I want to run a report which shows me all the vendor ledgers on behalf of the current filters on Journal Template and Journal Batch Name.

To apply the filters I had written the below code on the OnAction trigger of Field :-

PrnGenJournal.RESET;
PrnGenJournal.SETRANGE("Journal Template Name","Journal Template Name");
PrnGenJournal.SETRANGE("Journal Batch Name","Journal Batch Name");
PrnGenJournal.SETRANGE("Document No.","Document No.");
PrnGenJournal.SETRANGE("Posting Date","Posting Date");
REPORT.RUNMODAL(50121, TRUE, TRUE, PrnGenJournal);


You can check the screen Shot as well.






This is just an example to get work faster . I hope you like the post.

Thanks.










No comments:

Post a Comment