web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Filter Records

(0) ShareShare
ReportReport
Posted on by 3,099

Hi

  I want to filter records in Purchase Order <= Posting Date Filter in Report.

Thanks

     

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Marcellus Profile Picture
    2,735 on at

    Hi Jsshivalik,

    If you are using the Purchase Header as a data item you can add the Posting Date field in the ReqFilterFields property for example:

    DataItemProperties.png

    When the users run the report, they don't have to manually add the field to the filters, they can just type in a filter like the below:

    5270.RequestPage.png

    If you would like to handle this in your C/AL code, add a Global Variable with type Date and add it to a field on the request page.

     Then you can add a SETFILTER to your PurchaseHeader - OnPreDataItem
    SETFILTER("Posting Date", '%1..', DateFrom);

    In this case you can also default the value of the date variable to TODAY or WORKDATE.

  • jsshivalik Profile Picture
    3,099 on at

    Hi

      Can u show the first image complete . I want Posting Date <= DateFrom

    Thanks

  • Suggested answer
    Binesh Profile Picture
    7,885 on at

    Hello, if you have a development Environment then Open the Purchase Header Table ID [38]  and add bellow code in function "SetSecurityFilterOnRespCenter"

    2017_2D00_07_2D00_01_5F00_16_2D00_04_2D00_54.png

  • Marcellus Profile Picture
    2,735 on at

    HI Jsshivalik,

    This image?

    5432.DataItemProperties.png

    In the ReqFilterFields field you can select fields from the table. More info about ReqFilterFields on MSDN: https://msdn.microsoft.com/en-us/dynamics-nav/reqfilterfields-property

  • jsshivalik Profile Picture
    3,099 on at

    Hi

       How to filter Posting Date as <= StartDate . Start Date is a variable.

    Thanks

  • Suggested answer
    Marcellus Profile Picture
    2,735 on at

    Hello,

    Use SETFILTER:

    StartDate := 01072017D;

    "Purchase Header".SETFILTER("Posting Date", '..%1', StartDate);

    This will produce this filter: "..01/07/2017".

    Check the Enter Criteria Filters on MSDN: msdn.microsoft.com/.../hh879066(v=nav.90).aspx

  • Verified answer
    Tina Menezes Profile Picture
    2,582 on at

    Hi,

    You can define your start date initially if required. Then you need to write the below setfilter code.

    PurchaseHeader.SETFILTER("Posting Date", '<=%1', StartDate);

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans