Query about filtering out Closed Periods

engsiong75engsiong75 Member Posts: 143
Hi

May I know if there is a way to use Setfilter logic to filter out the Closing Periods?

This is the code that I managed to develop so far but it is not exactly very elegant.

PDate :=0D;
PDate := CLOSINGDATE("G/L Entry"."Posting Date");
IF PDate = "G/L Entry"."Posting Date" THEN
CurrReport.SHOWOUTPUT(FALSE)
ELSE
CurrReport.SHOWOUTPUT(TRUE);

Thank you,

Tan Eng Siong

Comments

  • kinekine Member Posts: 12,562
    CurrReport.SHOWOUTPUT("G/L Entry"."Posting Date" <> CLOSINGDATE("G/L Entry"."Posting Date"));
    

    ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • pdjpdj Member Posts: 643
    We can't use SETFILTER to ignore closing dates, unfortunatly. :-(
    However, your solution with SHOWOUTPUT might lead to incorrect Totals, so I will strongly suggest using CurrReport.SKIP instead. (And always try to put your code in the OnAfterGetRecord instead of the OnPreSection as I guess you are using now)

    PS: Now we are in the business of making short and precise code:
    IF "Posting Date" = CLOSINGDATE("Posting Date") THEN
    CurrReport.SKIP;
    8)
    Regards
    Peter
  • engsiong75engsiong75 Member Posts: 143
    Sigh. This will make the report run slower. Thanks for the info.
Sign In or Register to comment.